hi al,
long time? :D
im having some dificult with some DLL export functions....
i can make my own DLL but when i try to register it with "regsvr32.exe" or call it from a VisualBasic ( thats what i need),
it return the error "Cant find DLL entry point".
what can i do ??? im confused .... when i try to load the DLL with a ASM coded prog it works but in VB it doesnt ......
there it goes the simplest code Box.asm:
Box.def :
this error comes along with the Make process too :
Box.def : warning LNK4017: library statement not supported for the target platform; ignored
Box.def : warning LNK4017: exports statement not supported for the target platform; ignored
thaks all for help? ?:lol:
ps:txt is just a sz macro
long time? :D
im having some dificult with some DLL export functions....
i can make my own DLL but when i try to register it with "regsvr32.exe" or call it from a VisualBasic ( thats what i need),
it return the error "Cant find DLL entry point".
what can i do ??? im confused .... when i try to load the DLL with a ASM coded prog it works but in VB it doesnt ......
there it goes the simplest code Box.asm:
.386
.model flat, stdcall
option casemap:none
include includes.inc
.data
.code
DllEntry proc hInstance:HINSTANCE, reason:DWORD, reserved1:DWORD
.if reason==DLL_PROCESS_ATTACH
invoke MessageBox,NULL,txt("Dll is loaded."),txt("Box"),MB_OK
.elseif reason==DLL_PROCESS_DETACH
invoke MessageBox,NULL,txt("Dll is unloaded"),txt("Box"),MB_OK
.endif
mov? eax,TRUE
ret
DllEntry Endp
ShowMessageBox proc Text:LPCTSTR
invoke MessageBox,NULL,Text,txt("Box"),MB_OK
ret
ShowMessageBox endp
End DllEntry
Box.def :
library "Box"
exports ShowMessageBox
this error comes along with the Make process too :
Box.def : warning LNK4017: library statement not supported for the target platform; ignored
Box.def : warning LNK4017: exports statement not supported for the target platform; ignored
thaks all for help? ?:lol:
ps:txt is just a sz macro
The statements in .def files are case sensitive, see msdn information about .def file rules
Changing your box.def file to the following
should fix it.
Changing your box.def file to the following
LIBRARY "Box"
EXPORTS
ShowMessageBox
should fix it.
oh...
the error on the link statement already gone .... it was a prob just like u said on .def file...
BUT :sad:
it still cant be registered.......
isnt the structure of the code wrong?
the error on the link statement already gone .... it was a prob just like u said on .def file...
BUT :sad:
it still cant be registered.......
isnt the structure of the code wrong?
You don't need to register a standard DLL.
RegSvr32 is for registering COM server DLLs.
These are SPECIAL DLLS with a standard and EXPECTED set of exports.
RegSvr32 actually just calls one of your dll functions, which is meant to do the dirty work.
For an example of a COM server dll, see any OCX file, as these are all renamed COM dlls.
RegSvr32 is for registering COM server DLLs.
These are SPECIAL DLLS with a standard and EXPECTED set of exports.
RegSvr32 actually just calls one of your dll functions, which is meant to do the dirty work.
For an example of a COM server dll, see any OCX file, as these are all renamed COM dlls.
If you want to call your DLL from Visual Basic you should declare the function as you do then declare Windows API functions:
Declare Function ShowMessageBox Lib "YourLibName" (ByVal lpText As String) As Long
If you'd like to use your ASM dll as you are doing with Visual Basic ActiveX DLL you should write lots of COM code. If you're using MASM32 check out masm32\com directory and you'll find a lot of interesting stuff.
Declare Function ShowMessageBox Lib "YourLibName" (ByVal lpText As String) As Long
If you'd like to use your ASM dll as you are doing with Visual Basic ActiveX DLL you should write lots of COM code. If you're using MASM32 check out masm32\com directory and you'll find a lot of interesting stuff.