how to use AttachProcess() ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by traumatic.

When i got this right, 'ProcedureDLL AttachProcess()' is used
as the DLL's entry point. AFAIK DLLEntryPoint procedures take
three parameters (handle of instance, notification code, reserved)

AttachProcess() is only called on a newly attached process, so
notification code is obsolete - but no matter how much parameters
I use (1,2,3), my app doesn't get over the entry-point.

It retrieves the hInstance however but doesn't work any further,
no matter if I'm returning #TRUE or nothing.

Using no parameters works fine but is kind of useless. (?)

Any hints on how to use AttachProcess() correctly?

TIA,
traumatic
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by traumatic.

well, sorry for getting on your nerves again...

i really don't want to cry but someone's got to know about this.
fred, at least you should know how this is supposed to work :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Yes. What do you want to do exactly in the AttachProcess() hook ? It has no parameter for now, but it could change (I don't use it for now)

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by traumatic.


Thank you for your answer!

So, how do you retrieve the base address of the dll from within the dll without getting hInstance as a parameter?

If there's another solution to this I don't seem to see right now, there's of course no need for parameters, since you already split the 'calling reasons' into four dedicated procedures (and 'reserved' isn't needed/used anyway).

Other than that, I was asking because doing it your way was new to me and quite different to what I was used to.
I never saw code where someone wrote four procedures when one would've been enough... :)
Post Reply