|
Try passing in NULL as the HINSTANCE for GetModuleFileName() - that means it retrieves the name of the current module. The most likely reason for theApp.m_hInstance not being initialised is that DllRegisterServer normally does not need to call DllMain(), so your normal application initialisation has not occurred.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
As you are registering EXE -- this is outproc server.
Why would you need regsvr32 for that (it's used for inproc servers)?
Instead, you should start your outproc server with /REGSERVER and process it properly in yours InitInstance (or whatever)...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
|
Is there a way to trap a mouse click on your taskbar window button.
My application does not have the title bar. So am facing two problems.
1. I cannot restore my application by clicking on the taskbar window button, if it is minimized.
2. On Windows 2000 if I choose Minimize All, my app is not minimized along with the other apps.
Help wanted badly!!!
Thanks,
Blade
|
|
|
|
|
I would like to execute an EXE from memory (instead of disk). Is this practical? If so, does anyone have any hints or suggestions as to how it can be accomplished?
|
|
|
|
|
Yes. Search MSDN and the Net for the PE file format.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I undoubtably have horrible MSDN searching skills, however the most I gleaned from a massive article with way too much information I'm not interested in was:
"When PE files are loaded into memory via the Windows loader"... bla bla bla.
I'm just wondering if there is some relatively easy way (in the Win32/C++ world) to launch a PE from memory (instead of disk)?
From disk we have lots of API's... WinExec, CreateProcess, ShellExecute, etc.
What's the basic technique for launching from memory? Is assembly required?
I'm just basically looking for a tidbit of information to give me a headstart -- before having to comprehend all of the information about PE files and apparently the Windows loader and such.
|
|
|
|
|
|
Hi!
I need to be able to launch a viewer for a given file from my application (Win32/MFC/C++). Ideally I'd like to present the user with choices similar to the "Open With..." feature of the explorer shell.
I tried SHGetFileInfo but it keeps returning 0 for the flag SHGFI_TYPENAME (failure).
So I assume there's two part in my quest:
1- Find the type (mime type?) a given extension (I don't necessarily have the file created yet -- i.e. I'd like the user to be able to choose before creating the file)
2- Find a list of suitable applications (path, "user friendly" name) that can open that mime type.
I seems like I could just go and fish the info from the registry, but would that work on any windows version?
Regards
R/
|
|
|
|
|
ralfoide wrote:
I could just go and fish the info from the registry
seems like the only way.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
Hi everyone,
Just a quick question. Is there a way to display binary when formatting a string? I know %d is decimal, %X is hex....is there one that even exists for binary?
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
There isn't a ready-made format specifier like %b that will format an integer in binary. You'll have to brew your own by walking the bits.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
NewHSKid wrote:
...is there one that even exists for binary?
No, you'll need to roll your own.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
There are several ways. Here are a few.
The example below will display the binary representation for the decimal 100. In addition to '#including' <bitset>, you'll also have to '#include' <limits>
cout<<"\n 100: " <<bitset<numeric_limits<unsigned int>::digits>(100)<<endl;
the="" example="" below="" will="" also="" display="" the="" binary="" configuration="" for="" decimal="" 85.
cout<<"\n="" 85:="" "="" <<bitset<8="">::bitset(85) <<endl;
there are="" some="" subtle="" differences="" between="" the="" first="" example="" and="" second,="" but="" biggest="" is="" that="" in="" second="" you="" interested="" only="" having="" eight="" bits="" to="" represent="" value,="" whereas="" you'll="" get="" 32="" value.="" iow,="" can="" restrict="" number="" of="" want="" have="" representing="" value="" you're="" displaying.
here's="" one="" for="" letters.="" it="" will="" show="" binary="" representation="" letter="" 'a'="" using="" 8="" bits.
cout<<"\n="" \"a\":="" "="" <<bitset<8="">('A') <<endl;
lastly, here's="" one="" to="" show="" a="" string="" of="" letters="" (e.g.="" "abcd").
bitset<32=""> Ltrs = bitset<numeric_limits<unsigned int>::digits>('ABCD');
cout<<"\n \"ABCD\": " <
|
|
|
|
|
Hi!
How can i determine that the pointer is pointing to a valid memory address??
e.g:
consider
class CTest
{
public:
void Release()
{
delete this;
}
};
CTest *pTest = NULL
pTest = new CTest();
pTest->Release();
If you look at the last statement i.e pTest->Release(); , the memory poionted by pTest is deleted, but pTest still contains some value. I want to determine whether the value in pTest is a valid address or not ? How can i do so ?
N.B, I've read somewhere that in MFC the is a function something like AfxIsValidAddress() , but i would prefer a non-mfc solution
|
|
|
|
|
You can use one of several Win32 APIs to check the validity of a pointer: IsBadCodePtr() , IsBadReadPtr() , IsBadStringPtr() and IsBadWritePtr() as well as the Huge analogs.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Unfortunately, AfxIsValidAddress() and related functions like IsBadReadPtr() don't tell you if the pointer has been freed or not. They know if the address can be read from and/or written to. You'll just need to get into the habit of assigning NULL to the pointer after delete has been called.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
class CTest<br />
{ <br />
public: <br />
CTest** m_ptr;<br />
CTest(CTest** ptr = NULL)<br />
{<br />
m_ptr = ptr;<br />
}<br />
~CTest();<br />
{<br />
if(m_ptr)<br />
*m_ptr = NULL;<br />
}<br />
void Release() <br />
{ <br />
delete this; <br />
}<br />
};<br />
<br />
<br />
CTest *pTest = NULL<br />
pTest = new CTest(&pTest);<br />
pTest->Release();
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Shah Shehpori wrote:
How can i determine that the pointer is pointing to a valid memory address??
There is a big difference between "valid memory" and "memory that contains valid data". Unfortunately the computer can only tell you about the former. Even after you delete a pointer, the memory is not usually removed from your app's process space, so you could go on dereferencing the pointer and not cause a GPF.
As someone else said, get in the habit of setting pointers to NULL after a delete or Release() call and you'll avoid such bugs.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Please help me to find some Assembler IDE which work on Win32.
(Kind of VASM).
I spend much time for surfing all over WWW but links I found was broken
Code Red
|
|
|
|
|
Hi guys,
I am just starting to use DirectShow. I've managed to make it play a video in a CStatic in my dialog box. But now I want to draw something else there, like, put something on top of the video that is playing. I've tried using the device context from the CStatic but that doesn't seem to work - I guess I "gave" it to DirectShow and don't have control over it anymore. Another possibility would be to put another CStatic in front of the video playing, but that doesn't seem to work either, the video just plays over everything! Any suggestions?
|
|
|
|
|
|
am trying to load JPEG2000 (J2k) image and make use of the scalability features provided by J2k
by showing the image while loading. The tutorials clearly show that there are two possible “modes”:
- Progressive by resolution (You load the picture and it becomes sharper while loading, something
like interlaced GIF)
- Progressive by accuracy (ROI – region of interest)
I am interested in the first: “Progressive by resolution”. So I want to show the image while loading
for example if you download a 2 MB image through Modem connection.
I am looking for a exemplary implementation - does not matter in which language or platform it is running.
I would be grateful for any help.
Regards,
gicio
|
|
|
|
|
There any good beginner tutorials on making a context menu plug-in for Internet Explorer. I have come across a few articles here but none of them have the source code or the point you to MSDN to read about it. Trying to find something thats easy to follow.
Thanks!
|
|
|
|
|
If you just want to add items to the IE context menu that is easy. I imagine there is a way to replace it, but don't know how. What are you trying to do?
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|