|
Hi Mazy
How can you make it delete itself, it will be in use at the time and therefore cause an access denied prompt???
Me
|
|
|
|
|
alternatively i have just thought, Make a second app and get that to delete the first, waiting for the first one to delete. Therefore you will be left with the second app. Which is just there to remove the first and contains no info. alternatively again make a batch file
|
|
|
|
|
Sorry, but then I can't help you!
But if you want an unsafe way to do it: Write something to a file (EXE, DLL or just a file) in binary (of course) and then read from that file to see if it has run before!
Understand?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
There a solution to that in msdn, if u don't find email me at blackhorus@caramail.com, so i can send u the article.
|
|
|
|
|
Yes.
Copy the file to a temp dir and run it from there. When the app ends, it should add a registry entry (I forget which) requesting Windows to delete it the next time Windows restarts.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Assuming the processor supports unique serial number:
#define cpuid __asm __emit 0fh __asm __emit 0a2h
UINT PSN, ID1, ID2, ID3;
__asm
{
mov eax, 01H
cpuid
mov PSN, edx
}
if (PSN&<s>0x20000</s> 0x40000)
{
__asm
{
mov eax, 01H
cpuid
mov ID1, eax
mov eax, 03H
cpuid
mov ID2, edx
mov ID3, ecx
}
}
else
{
}
If everything works out ID1, ID2, ID3 should contain the unique 96 bit ID. I havn´t tested the code since I don´t have a PIII, but I hope it works...
More info on cpuid here (pdf).
Hope this helps
/moliate
|
|
|
|
|
|
There was a litte bug in the sample program...
Bit 18 is 0x40000, not 0x20000. If you havn't discovered it yourself I think I should save you some trouble....
/moliate
|
|
|
|
|
at first, because my poor english,I wish you can understand me!
If I draw some lines or pictures in a DC,How can I get the bitmap data and save it as a bitmap?
thank you for your help!
Don't look at me in that way!
|
|
|
|
|
CBitmap m_pGenBitmap = new CBitmap();
CClientDC dc(NULL);
int nWidth = 128;
int nHeight = 128;
HDC hDCScreen = dc.GetSafeHdc();
HBITMAP hbm = ::CreateCompatibleBitmap(hDCScreen,nWidth,nHeight);
if (hbm != NULL)
{
HDC hDCGlyphs = ::CreateCompatibleDC(hDCScreen);
HBITMAP hbmOld = (HBITMAP)::SelectObject(hDCGlyphs, hbm);
CDC *pDC2 = CDC::FromHandle(hDCGlyphs);
CRect r(0,0,nWidth,nWidth);
// your owner draw
pDC2->FillRect(&r,&CBrush(RGB(0xff,0xff,0xff)));
m_pFillUnit->Draw(pDC2,&r,0);
// end
SelectObject(hDCGlyphs, hbmOld);
m_pGenBitmap->m_hObject = hbm;
::DeleteDC(hDCGlyphs);
}
return m_pGenBitmap;
|
|
|
|
|
Check out Mike Dunns FAQ, I think it was something about that there...
or
see in the Bitmaps & Palettes section here on CP
or
Search this forum, because you're not the first who asking!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Can someone tell me the easiest way in .NET to overload a base class function? basicly what I've been doing is looking at how the base class and just copying/pasting the code and modifying it, but i figure there has to be a built in way to overload a function without doing this?
thanks!
-dz
|
|
|
|
|
working under w2k platform, after changing the ip address, you needn't restart the system, so I want to write a programme that can change the ip address, mask gateway and DNS and so on dynamically, how should I do? thanks.
|
|
|
|
|
Chaps and chapets
Having trouple with testing C++ 'init'
cannot seem to surpress the violations within MFC macros
any comments welcome dudes
The Wudan Master (deceased)
|
|
|
|
|
I have CString object,I want to divide it 3 by 3.For example my string is this:"123456789"
I want to have threee CString like this:
"123","456","789"
How can I do it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Use CString::Mid() in a loop
|
|
|
|
|
Thanks ,I'll check it.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
How do I manage to use an own Icon for my executable (no MFC used yet) so that the usual Windows-Icon for exes is replaced by my Icon ?
|
|
|
|
|
hmm, I think this question is answered several times in this forum, it might even be in the Q&A section. Anyway, to change this icon, modify the Icon whose ID is IDR_MAINFRAME, remember to change both of them, the standard one (32x32) and the small one (16x16).
|
|
|
|
|
I know that procedure when I have a for example dialog-based app using MFC. But I dont use MFC and aint got any resources yet. What do I have to do ?
|
|
|
|
|
The resources are crucial - if you don't have them you can't have icons. When explorer try to flash an icon up, it just uses the first icon it comes across in the resource sector. Usually we arrange things so that if you have several icons, the main one is the first one uncovered. There really is no way around you making an .rc, and doing it that way - not that I nkow of anyway.
I hope that helps.
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
It helped, got my Icon now. Thanks a lot to both of you.
|
|
|
|
|
Hi.
I am developing a dialog based app.a costum header file for common defination has been included in stdafx.h,when i build the app,the compiler say the common definations is redefined in appname.obj.However after I install the latest MS Platform sdk,the problem disappear.Please tell me why?
|
|
|
|
|