Women in Technology

Hear us Roar



Article:
  Creating a Windows DLL with Visual Basic
Subject:   Problem with DEF file
Date:   2006-04-10 12:21:37
From:   xfile101
Ran the above tutorial with minimal problems, however, created my own DLL and get error loading DLL. I suspect it's in the DEF file. If I remove the def file I can create the DLL albeit, the DLL doesn't work when called but if I add the def file and compile I get error in loading DLL. Here's my def file:
NAME aProper
LIBRARY String 'MathMod
DESCRIPTION "Add-on Library String Routines"
EXPORTS DllMain @1
myProper @2
AddrProper @3


I changed LIBRARY serval times to 'String', 'String Library' etc as I suspect this is the problem but not sure. If someone could help I would appreciate it.

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Problem with DEF file
    2006-04-11 09:54:32  xfile101 [View]

    Ok, fixed that problem and others and now my DLL works great IF I use VB.exe. If I use it anywhere else, for instance excel or access, it crashes. I see other people have had this problem while others have not. I've been at this all day and really getting frustrated at this whole concept. All I want to do is use a DLL in excel and access. Can someone please point me inthe right direction? I tried to catch the error before it crashes but can't. I did manage to at least get the program not to crash by declaring the DLL in a module in excel like such:
    Declare Function MyProper Lib "C:\WINDOWS\System32\ProperCase.dll" _
    Alias "C:\WINDOWS\System32\ProperCase.dll MyProper@2" (ByVal var As Variant) As Variant

    but if I do this I get the #VALUE error. I'm passing strings and my function takes a Variant I have chaged these to match (function takes a string)but still no luck. If someone can help I would appreciate it.