|
I am trying to implement a CRC check in my program. I built my program and as a test I used a program that I found to check the CRC of my program. The program gave me the CRC as "708f0d1". With out making changes to any of my code, I rebuilt my program and ran the CRC check again. This time it said that the CRC was "94d40369" I wanted to put code in a dll that would check the CRC value of my program with the expected value, but if the CRC changes when you compile or build your program how is it possible to implement this type of check. If you can help me it would be appreciated.
Thanks.
|
|
|
|
|
Anonymous wrote:
how is it possible to implement this type of check
regenerate the code that tests the CRC each time you rebuild the EXE - make it a post-build step in your EXE project.
-c
Gourmet, n:
Anyone whom, when you fail to finish something strange or
revolting, remarks that it's an acquired taste and that you're
leaving the best part.
|
|
|
|
|
Ok, thanks, I will try it.
|
|
|
|
|
Hello again,
Please tell me What first message affter OnInitialDialog ?
I mean first message after dialog loaded ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Why ?
I'm not sure of the answer, but maybe the answer to your problem lies elsewhere....
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
The best way to find out what messages are coming to your window (and in what order) is to run Spy++ on the application.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
IIRC the first message any window get is WM_GETMINMAXINFO (or is it NC_CALCSIZE?).
Perhaps you should add some printf-debugging to your dialog main procedure and check for yourself?
|
|
|
|
|
The fact that you're asking the question suggests a problem with your design.
It is unwise to rely on any message order (except WM_NCDESTROY). The order of messages may vary from one OS to another or when other circumstances change.
As other posters have said it shouldn't be difficult to find out which message arrives first after WM_INITDIALOG but you should not depend on it always being the same.
Regards,
Phil
|
|
|
|
|
Is there an api that I can use to check if the current user is administrator.
Thank you
Orcun Colak
|
|
|
|
|
There's recently documented APi called 'IsAdmin' - check online MSDN. There's also KB article Q118626 which has similiar function.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
The alleged IsUserAnAdmin() API doesn't exist in shell32.dll like MS claims. Use Depends and see for yourself. Weird.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
Use Depends and see for yourself. Weird
Yeah, you're right. Maybe it's one of functions exported by ordinal??
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Sam Blackburn's Win32 Foundation Classes (WFC) [^] provide a function called wfc_am_i_administrator that serves this purpose.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
orcun colak wrote:
Is there an api that I can use to check if the current user is administrator.
No. You have to do it manually. Search for SID in MSDN.
|
|
|
|
|
I've tried using a CStatic control in my CView derived class to animate a bitmap. I use 4 separate bitmaps but after a couple of minutes (variable) it fails and I get an error related to CBitmap. This also messes up all of Windows graphically. So, after playing around with it, I decided to give up on CBitmap and CStatic. FYI, here is what I had:
MyViewClass::OnTimer(UINT nIDEvent)
{
if(nIDEvent == m_AnimTimerId)
{
if(BmpId == IDB_ASTLEFT + 4)
BmpId = IDB_ASTLEFT;
CStatic *pTargetCtrl = (CStatic *) GetDlgItem(IDC_ERR_STATIC);
ASSERT(pTargetCtrl != NULL);
m_CurrentBmp.Detach();
m_CurrentBmp.LoadBitmap(BmpId);
pTargetCtrl->SetBitmap(m_CurrentBmp);
BmpId++;
}
}
So, I decided to use memory DCs and blt it onto the screen. However, I am not sure I am obtaining the DC correctly since I get an error in the bitblt routine now used in the timer routine.
void CStatsView::InitialDraw()
{
pTheDC = GetDC();
CBitmap bmp1, bmp2, bmp3, bmp4;
bmp1.LoadBitmap(IDB_ASTLEFT);
bmp2.LoadBitmap(IDB_ASTLEFT+1);
bmp3.LoadBitmap(IDB_ASTLEFT+2);
bmp4.LoadBitmap(IDB_ASTLEFT+4);
dcMem1.CreateCompatibleDC(pTheDC);
dcMem2.CreateCompatibleDC(pTheDC);
dcMem3.CreateCompatibleDC(pTheDC);
dcMem4.CreateCompatibleDC(pTheDC);
dcMem1.SelectObject(&bmp1);
dcMem2.SelectObject(&bmp2);
dcMem3.SelectObject(&bmp3);
dcMem4.SelectObject(&bmp4);
}
The OnTimer code now looks like this:
if(BmpId == IDB_ASTLEFT + 4)
BmpId = IDB_ASTLEFT;
switch(BmpId)
{
case IDB_ASTLEFT :
pTheDC->BitBlt(0, 0, 7, 7, &dcMem1, 0, 0, SRCCOPY);
break;
case IDB_ASTLEFT + 1 :
pTheDC->BitBlt(0, 0, 7, 7, &dcMem2, 0, 0, SRCCOPY);
break;
case IDB_ASTLEFT + 2 :
pTheDC->BitBlt(0, 0, 7, 7, &dcMem3, 0, 0, SRCCOPY);
break;
case IDB_ASTLEFT + 3 :
pTheDC->BitBlt(0, 0, 7, 7, &dcMem4, 0, 0, SRCCOPY);
break;
}
BmpId++;
If that is the case, where in my view should I obtain a pointer to the DC?
|
|
|
|
|
JohnnyG wrote:
If that is the case, where in my view should I obtain a pointer to the DC?
Use CClientDC, which encapsulates calls to GetDC/ReleaseDC. You should also use CClientDC in InitialDraw.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
|
I cannot get my progress bar to show on the status bar. The only way I found around it to show is to use MyPBar.SetWindowPos(...). Doing it this way, though, mispositions the progress bar on different computers. How do I lock it to my status bar? Here's what I have:
In MainFrm.cpp:
CRect rect;
m_wndStatusBar.GetItemRect(2, &rect);
m_ProgBar.Create(WS_VISIBLE | WS_CHILD | PBS_SMOOTH,
rect, this, ID_INDICATOR_PBAR);
m_ProgBar.SetRange(0,100);//Set the range to between 0 and 100
m_ProgBar.SetStep(1);//Set the step amount
//the line below is brute force, can't find out how to display ProgBar
m_ProgBar.SetWindowPos(NULL,782,714,105,16,NULL);
In CView.cpp (or elsewhere):
.
.
.
CMainFrame* pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;//pointer to mainframe object
.
.
.
pFrame->m_ProgBar.StepIt();//never shows on status bar
Any suggestions? Thx
ralf.riedel@usm.edu
|
|
|
|
|
You should make progress control a child of status bar, not main frame. Check Q142202 for details.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Q142202? Could not find that article.
ralf.riedel@usm.edu
|
|
|
|
|
|
|
Hello there,
How can i change windows background ?
Is there any API function for it ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
you can overwrite PreCreateWindow function.
|
|
|
|
|
I wanna change background of Windows OS !!!
Not dialogs ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|