I made the buffer global like you said, it's not working, I get compile errors.

But the function works the same way as in DLL the otherway, you answered the question.
Posted on 2003-03-07 16:20:08 by Knight Chat X
sluggy qutoed
Sorry, but that is the funniest thing i have heard in a long time, who told it to you? :rolleyes: This is so wrong i'm surprised they didn't try to sell you the Statue of Liberty at the same time ;)

REALLY?!??!?!?! WOW man, i never knew that.. that is soooooo awsome, I could use assembly in VB?!?!?! Coool!

Well, it is kind of true. NOT in the VB IDE ( no form, module, class or whatnot) You can by a hack change what the vb link does.... Maybe that is what the OP was talking about? Dunno. Oh, the OP is KCX. didn't see that

Dude, I have been using VB for the past 5+ years and I NEVER heard that... You are dreaming. You can modify the way link acts in VB6 but that is it.. you cannot use assembly with VB unless it is a dll or such...

So, you have compile errors... we all get em... post your code... we are not mind readers.. :grin: (I wish)

I just read more of your post KCX, and you do not have to create a window in Sub Main! And you cannot remove all remove all referances in your project!

Like I said, post the code you are getting errors with and I will help ya out...
Posted on 2003-03-07 17:33:14 by Gunner
I don't use VB at all but I would think that since it is not a true compiled language it would have trouble with ASM code. Though there is a company that claims to have an addin for this here , I don't have VB so I have never checked it.

Posted on 2003-03-07 23:49:32 by donkey
Never heard of that one, here's another Add-In:
Posted on 2003-03-08 00:47:03 by Knight Chat X
Gunner, here's the asm file:
Posted on 2003-03-08 02:46:48 by Knight Chat X
I could not run it properly to test it because it seems to be missing a few things (resource file and a few variables) but I changed a few things and commented em.

You should spell out the data types i.e. don't use db, dw, dd instead use BYTE, WORD and DWORD etc since I think you gotten confused because you declared the buffer as a word when the api returns a dword...

The changes should work.
Posted on 2003-03-08 11:13:37 by Gunner
Wasn't able to upload anything but the .asm file, I get upload problems from ISP alot it's annoying...

Tried out that modified file, it compiles now, but MessageBox doesn't popup at all. =o(
Posted on 2003-03-08 17:30:02 by Knight Chat X
You can zip up the needed files and attach the zip file here. :)
Posted on 2003-03-08 17:35:31 by Gunner
ok, here's the code with the icon & rc files, I changed the buffer to DWORD like you said, yep I was getting it a bit mixed up.

The code compile's, but now the MessageBox won't display.
Posted on 2003-03-08 18:32:26 by Knight Chat X
WORD is rarely used.

mov Wwd, 340
mov Wht, 250
ADDR szClassName,
ADDR szDisplayName,

could be used as

ADDR szClassName,
ADDR szDisplayName,
Posted on 2003-03-08 20:19:14 by roticv
Nice, since ya looked at the code, were you able to get MessageBox to display the information in the txtbuffer?

See the window's create message is supposed to fire the test procedure when the main window is first loaded, when this happens the window text is stored in global variable then the data in the variable is displayed, this is just for testing, for some reason everything compiles without error, but the MessageBox will not pop up... =o(
Posted on 2003-03-08 22:00:09 by Knight Chat X
The attachment works.

The message box is not showing because your have to return 0 if you process WM_CREATE, which you are not. after invoke ShowTextBoxText,hWin add:
xor eax, eax

and your message box will show.. It will show garbled text but that is a differant story.

I would suggest reading some more messages on this board about strings and some tutorials..
Posted on 2003-03-08 22:14:42 by Gunner
ok, I'll do that then, I don't understand why it'll show the MessageBox when using a local buffer in the procedure compared to when it's using a global buffer though, should work the same...

The second the main window loads and the create message fires, it's kinda like the initialize/Form_Load event in VB to me.....
Posted on 2003-03-08 22:37:21 by Knight Chat X
I used a local to hold the pointer to the buffer because I do not see a need to make it global. Once the procedure is done, the pointer to the buffer is useless.

I missed that not returning 0 for WM_CREATE in your code originally. Then I went over it again and that caught my eye. So I added the correct code, and it works.

If you have a quick connection (DSL+) download the Platform SDK, it will describe all the apis and messages and how you have to handle them...
Posted on 2003-03-08 22:57:02 by Gunner
You really worked out that code, yea, the idea was to use a global buffer to store text after the procedure had been run, then later re-use the buffer when needed if possible, but you've helped me enuff on this question so I'll move forward now and try and review all of this.

Platform SDK, hmmm, got a copy of that somewhere on CD. =o)

Maybe someday I'll be able to help you in return as you've helped me, many thanks, see ya later...
Posted on 2003-03-08 23:10:33 by Knight Chat X