1. instance()???
- Posted by Andy Serpa <ac at onehorseshy.com> Jul 09, 2004
- 542 views
I thought instance() was supposed to give me a unique handle to the program? On my system, instance() returns the value 4194304 seemingly in all circumstances in any program, even if the programs are running simulatenously. ???
2. Re: instance()???
- Posted by Bernard Ryan <xotron at bluefrog.com> Jul 09, 2004
- 502 views
Andy Serpa wrote: > > I thought instance() was supposed to give me a unique handle to the program? > On my > system, instance() returns the value 4194304 seemingly in all circumstances in > any > program, even if the programs are running simulatenously. ??? > Andy: if you don't think instance() is returning the right value, you can check it with the following function by passing it a NULL. hInst = GetModuleHandle(null) Bernie
3. Re: instance()???
- Posted by Andy Serpa <ac at onehorseshy.com> Jul 10, 2004
- 508 views
Bernard Ryan wrote: > > Andy Serpa wrote: > > > > I thought instance() was supposed to give me a unique handle to the program? > > On my > > system, instance() returns the value 4194304 seemingly in all circumstances > > in any > > program, even if the programs are running simulatenously. ??? > > > > Andy: > > if you don't think instance() is returning the right value, > you can check it with the following function by passing it a NULL. > > hInst = GetModuleHandle(null) > Same result. Shouldn't it be different for different programs and different instances of the same program running at the same time. It returns 4194304 always. What API function would I use to get the unique process id?
4. Re: instance()???
- Posted by Don <eunexus at yahoo.com> Jul 10, 2004
- 555 views
> > > I thought instance() was supposed to give me a unique handle to the > > > program? On my > > > system, instance() returns the value 4194304 seemingly in all > > > circumstances in any > > > program, even if the programs are running simulatenously. ??? > > > > > > > Andy: > > > > if you don't think instance() is returning the right value, > > you can check it with the following function by passing it a NULL. > > > > hInst = GetModuleHandle(null) > > > Same result. Shouldn't it be different for different programs and different > instances > of the same program running at the same time. It returns 4194304 always. > What API > function would I use to get the unique process id? Umm, I couuld be waaaay off base here, but if you are running interpreted code (ie non-compiled) wouldnt it use the same exw.exe every time? =) Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
5. Re: instance()???
- Posted by Don <eunexus at yahoo.com> Jul 10, 2004
- 606 views
> > > > I thought instance() was supposed to give me a unique handle to the > > > > program? On my > > > > system, instance() returns the value 4194304 seemingly in all > > > > circumstances in any > > > > program, even if the programs are running simulatenously. ??? > > > > > > > > > > Andy: > > > > > > if you don't think instance() is returning the right value, > > > you can check it with the following function by passing it a NULL. > > > > > > hInst = GetModuleHandle(null) > > > > > Same result. Shouldn't it be different for different programs and different > > instances > > of the same program running at the same time. It returns 4194304 always. > > What API > > function would I use to get the unique process id? > > Umm, I couuld be waaaay off base here, but if you are running interpreted > code (ie non-compiled) wouldnt it use the same exw.exe every time? =) Crap im tired tonight =) Please ignore the above posting... GetModuleHandle does *NOT* return a unique value. As a matter of fact, it is (currently) the same across all Windows platforms. 400000 hex or 4194304 decimal. Alot of coders I know hard code this value instead of calling the API function which is slower. Of course you should always use the API because MicroSoft does not guarentee it will stay this way for future versions. If you need a unique number like the ThreadID you should look elsewhere... Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com