ok, it's vbasic again, but i really mean it. the following program tries to load "msvbvm60.dll" (should work), get the address for "rtcInputBox" (should work too), and then call that function with parameters. !but: when i call it, the programs exits with a page fault. i guess this is due to false parameters passing. does anybody know how to solve this problem? is there something with the number of parameters or the type of them?
PLEASE help!!!!! i want to get it.
PLEASE help!!!!! i want to get it.
.386
.model flat, stdcall
option casemap: none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
hMsg HINSTANCE 0 ; contains handle of library
iProc dd 0 ; address of function
;
szDll db "msvbvm60", 0 ; name of library
szProc db "rtcMsgBox", 0 ; name of function
szTText db "Text", 0 ; message prompt
szTCapt db "Caption", 0 ; message caption
;
.code
main:
push offset szDll ;
call LoadLibrary ; try to load "MSVBVM60.DLL"
cmp eax, 0 ;
jz @error ; if eax==0 -> fail
mov hMsg, eax ; else store handle
push offset szProc ; function
push hMsg ; handle to library
call GetProcAddress ; get address
cmp eax, 0 ;
jz @error ; if eax==0 -> fail
mov iProc, eax ; store address
push 0 ; msg-type
push offset szTCapt ; msg-caption
push offset szTText ; msg-prompt
push 0 ; owner handle
call MessageBoxA ; success confirmation thru user32.dll
;; ---------------------------------------------------
;; the following piece of code causes an error and brings
;; up the debug window: page fault in msvbvm60.dll
;;
push offset szTCapt ; message caption
push 48 ; message type
push offset szTText ; message prompt
call [iProc] ; call rtcMsgBox
;;
;; ---------------------------------------------------
push hMsg ;
call FreeLibrary ; free handle to "MSVBVM60.DLL"
jmp @end
@error:
jmp @end
@end:
push 0
call ExitProcess ; exit program
end main
I see more errors than sense in your code. :rolleyes:
name them!!! for god's sake .... i don't need to be told there are errors -- tell me where they are!
Afternoon, ploptor.
Shouldn't ...
be...
?
Also...can VB dlls actually be called just like normal dlls? I was under the impression that they're only used be the VB virtual machine? (note: I really wouldn't have a clue regarding this :grin: ).
Cheers,
Scronty
Shouldn't ...
szDll db "msvbvm60", 0 ; name of library
be...
szDll db "msvbvm60.dll", 0 ; name of library
?
Also...can VB dlls actually be called just like normal dlls? I was under the impression that they're only used be the VB virtual machine? (note: I really wouldn't have a clue regarding this :grin: ).
Cheers,
Scronty
vb6 runtime dlls do export just like any other dll. I once saw a C program that was written almost entirely against the vbm6 dll to handle it's memory allocation and pointers and some of it's internal COM memory as well. not a very easy to understand program but it was internesting. I've used a utility to intercept thec ompile process for VB only to see it actually uses the C3 and ML compiler that exports to assembly and compiled by masm. The c3 compiler with the /basic command line option. However, this isn't a feat I'd have interst in to use the vbm6.dll in my own applications.
Thanks,
_Shawn
Thanks,
_Shawn
Scronty,
If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended.
Afternoon, ploptor.
Sorry. It seems this messageboard has decided to become "elitist", and members would rather ridicule and insult other members' comments, rather than actually help someone (yourself) learn to use win32 assembly programming.
Cheers,
Scronty
Sorry. It seems this messageboard has decided to become "elitist", and members would rather ridicule and insult other members' comments, rather than actually help someone (yourself) learn to use win32 assembly programming.
Cheers,
Scronty
Scronty, I don't think there was any ridicule ment by bitRAKE, but, eh, bazik that was a bit uncalled for. :( .
Ploptor, I'm only sorry I haven't played with VB to help you, but perhaps if the routines are stdcall then by looking at the number following the procedure name you could figure out how many parameters to pass, i.e. the number divided by 4. :)
Ploptor, I'm only sorry I haven't played with VB to help you, but perhaps if the routines are stdcall then by looking at the number following the procedure name you could figure out how many parameters to pass, i.e. the number divided by 4. :)
Im making a wild guess here but the VB function might be expecting unicode strings?
Bazik - I see more errors than sense in this statement. In fact I see very few errors in the code.
Bazik - I see more errors than sense in this statement. In fact I see very few errors in the code.
Scronty, I don't think there was any ridicule ment by bitRAKE.
@_Shawn:
do you still have that program? or could you tell me where i can find it?
I once saw a C program that was written almost entirely against the vbm6 dll to handle it's memory allocation and pointers and some of it's internal COM memory as well. not a very easy to understand program but it was internesting
do you still have that program? or could you tell me where i can find it?
ploptor,
using the VB runtime is probably more complex than you think, I have never seen a published set of functions and it is not an open interface so you may be stuck with searching for stuff that is just not generally available.
There is no problem using LoadLibrary(), GetProcAddress(), FreeLibrary() but having a documented interface to reliably call the functions is necessary to be able to use the DLL.
Is there some particular reason why you want to use the VB runtime DLL ?
Regards,
hutch@movsd.com
using the VB runtime is probably more complex than you think, I have never seen a published set of functions and it is not an open interface so you may be stuck with searching for stuff that is just not generally available.
There is no problem using LoadLibrary(), GetProcAddress(), FreeLibrary() but having a documented interface to reliably call the functions is necessary to be able to use the DLL.
Is there some particular reason why you want to use the VB runtime DLL ?
Regards,
hutch@movsd.com
Is there some particular reason why you want to use the VB runtime DLL ?
Thats why I posted my reply above :)
to bazik:
Would you please tell us the many errors of ploptors code, bazik?
I see more errors than sense in your code.
Would you please tell us the many errors of ploptors code, bazik?
I admit I discovered the same as Scronty which was not a real error :)
Anyway, IMHO its senseless to use MSVBVM60.dll from assembly :)
Anyway, IMHO its senseless to use MSVBVM60.dll from assembly :)
Anyway, IMHO its senseless to use MSVBVM60.dll from assembly :)
bazik, as I have already told you: you should be more reserved in your responses. If you cant help you should consider to resign as mod.
somebody should start h4xoring MSVBVM60.dll or maybe ask help with SysInternals(they have a good job on "documenting" undocumented functions) or send billions of emails to Microsoft to create a documentation for this. :)
/me I don't have the time to do this. I have a job, school...
/me I don't have the time to do this. I have a job, school...
What does the VB Library provide that this community can't?
What does the VB Library provide that this community can't?
bloat.