|
Many thanks!!!! I can't believe it
|
|
|
|
|
Hey, thank you.. i was struggling to fix this issue since 2days... you saved my time....
I really wonder how you ended up changing the include path
|
|
|
|
|
When you create the process you would be getting the handle to the window (From the ProcessInfo) with it creates.... just use that HWND as an argument to "::MessageBox"... use the global "::MessageBox" and not the AfxMessageBox or the MessageBox from inside a class inherited from a CWnd.
or course you would need to give it every argument and none will be optional/default.
|
|
|
|
|
Thnx for your reply.
I have created the MessageBox in a way u told me. but it solves my problem partially only when I display a messagebox it is display in minimize mode. I am using something like this in my project ( not Exactly but like this)and I want the MessageBox to be displayed on the TOP of Notepad Window.
void CProcessDlg::OnBnClickedOpennotepad()<br />
{<br />
<br />
LPSTR str = {"c:\\WINNT\\system32\\notepad.exe" };<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
CreateProcess( NULL,str,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi ); <br />
<br />
::MessageBox(NULL,"Should be on the TOP","Hi",0);<br />
<br />
<br />
<br />
}
Please Help me If u know How to solve it.
|
|
|
|
|
Hey Thnx. Problem Solved. i used ::MessageBox() with MB_APPLMODAL and Wolla !!!!!.
ITs Done.
|
|
|
|
|
I had posted this message before, but because I haven't received any good suggestions, I am rewritting. I want to develop a new GINA DLL, and I want to know the security holes of it. I mean how an attacker can attack this DLL? for example he can replace his own GINA DLL in system32 and change the corresponding key value in Registry to his GINA's name. What are other ways of attacks to a custom GINA DLL? For more information, this GINA DLL is used for smart card Logon.
Thanks in advance,
|
|
|
|
|
Hello,
I am facing problem while printing crystal report 11 calling function from UI Thread .When I am using the same function calling directly on Button Click event ,all goes weel .But when I am trying to call the same function inside UIThread it give 2 errors :
1.This document could not be opened. It does not appear to be a Crystal Report document.
This document has the expected file extension (.RPT) but it seems to be corrupt. If the report use to work, try opening it with a different version of Crystal Reports and if that still does not work, please contact your administrator. (followed by an OKAY button)[/CODE] After clicking on the "Okay" buttom, the following error message is received:
2. [CODE]Invalid TLV record.
Please help me .
Thanks in advance
Divya Prakash
|
|
|
|
|
Hi,
I am using VS.net 2003 with VC++ and Crystal Report templates generated using Crstal report 8.0 to generate a report. Now I upgraded to Crystal report 11.0. When I am using cystal report 11.0 templates to genrate a report the applcation fails to load the report. I tried replacing the older version of dll's with the latest ones but still it did not work. It's crashing because of Crystl32.ocx file.
There Is Nothing Right & Wrong
|
|
|
|
|
Hi guys,
I have been googling all day and have not been able to find very much information on how to add and modify the group policy options in the 'User Rights Assigment' section.
To get to where I am you can run gpedit.msc, and then drill down to 'Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment'.
I am wanting to add and remove user names from the options listed in this section. For example, I want to be able to add a user name to the 'Deny logon locally' GP.
As I have not probably made this clear yet, I want to edit these options from within visual c++ programmatically.
Any help would be great!
, Thanks!
-Zeek.
|
|
|
|
|
I have been trying to use FlashWindow and FlashWindowEx in an attempt to mimic the flash that occurs in SPY++ when you right click on a window and choose "highlight". Specifically, I'm trying to do this with the MainFrame for an MFC Doc/View app.
Windows 2000
Platform SDK installed and paths set
Visual C++ 6.0 and Visual C++ 2003
No compile or link errors
When I run FlashWindowEx from a CMainFrame method it works (flashes the child view) when using a child window handle but when I use the main frame handle it only blinks the task manager button. The application is not minimized or iconic during testing.
CWnd* pWnd=GetWindow(GW_CHILD);
if (pWnd) {
FLASHWINFO flashInfo={0};
flashInfo.cbSize=sizeof(FLASHWINFO);
flashInfo.hwnd=pWnd->m_hWnd;
flashInfo.uCount=3;
flashInfo.dwTimeout=75;
flashInfo.dwFlags=FLASHW_ALL;
::FlashWindowEx(&flashInfo); // Flashes the child fine
}
//*****************************
FLASHWINFO flashInfo={0};
flashInfo.cbSize=sizeof(FLASHWINFO);
flashInfo.hwnd=this->m_hWnd;
flashInfo.uCount=3;
flashInfo.dwTimeout=75;
flashInfo.dwFlags=FLASHW_ALL;
::FlashWindowEx(&flashInfo); // Only flashes the task manager button
//*****************************
Any ideas on what I'm missing or doing wrong?
-- modified at 17:01 Wednesday 15th August, 2007
|
|
|
|
|
Have you tried to get your MainWindow with:
AfxGetApp()->m_pMainWnd;
and then do the same as you were doing?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I was running it from CMainFrame.
I may be wrong, but aren't those two the same?
Just for grins, I tried m_pMainWnd but it just flashes the button in the task manager.
Did you get it to work on your machine or are you taking a shot in the dark? If you got it to work on your box, I'll keep at as I'm probably missing something right under my nose (again).
Either way, thanks for the suggestion.
|
|
|
|
|
I am trying to get a bitmap to load into a static picture control.
The class definition contains the following variables:
class CGraphTestDlg : public CDialog
...........
CBitmap ONELogo;
CStatic m_onelogo; //this is attached to a picture control
CGraphTestDlg::OnInitDialog() does the following:
.....
ONELogo.LoadBitmap(IDB_BITMAP1);
m_onelogo.SetBitmap(ONELogo);
This is pretty much right out of a microsoft example of how load a bitmap but the picture is never displayed. What am I doing wrong?
Wayne King
|
|
|
|
|
WayneK100 wrote: What am I doing wrong?
Have you seen this or this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I got the bitmap to load shortly after I posted the question (of course) but the image is way to big for the area that I want to put it in. Is there a way to resize it (at run time) to fit within the control's defined area?
Wayne
|
|
|
|
|
WayneK100 wrote: Is there a way to resize it (at run time) to fit within the control's defined area?
Something like this should work...
CBitmap SrcBmp;
SrcBmp.LoadBitmap(IDB_BITMAP1);
BITMAP BmpInfo;
SrcBmp.GetBitmap(&BmpInfo);
CRect DestRect;
m_onelogo.GetClientRect(&DestRect);
double XScale = (double)DestRect.Width() / (double)BmpInfo.bmWidth;
double YScale = (double)DestRect.Height() / (double)(BmpInfo.bmHeight;
double ScaleFactor = XScale < YScale ? XScale : YScale;
int nNewBMWidth = (int)((double)BmpInfo.bmWidth * ScaleFactor);
int nNewBMHeight = (int)((double)BmpInfo.bmHeight * ScaleFactor);
CDC SrcDC;
SrcDC.CreateCompatibleDC(NULL);
CBitmap *pOldBmp1 = SrcDC.SelectObject(&SrcBmp);
ONELogo.CreateCompatibleBitmap(&SrcDC, nNewBMWidth, nNewBMHeight);
CDC DestDC;
DestDC.CreateCompatibleDC(NULL);
CBitmap *pOldBmp2 = DestDC.SelectObject(&ONELogo);
DestDC.StretchBlt(0, 0, nNewBMWidth, nNewBMHeight, &SrcDC, 0, 0, BmpInfo.bmWidth, BmpInfo.bmHeight, SRCCOPY);
SrcDC.SelectObject(pOldBmp1);
DestDC.SelectObject(pOldBmp2);
m_onelogo.SetBitmap(ONELogo); Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks once again. All the help got us through the hard-to-find details and get this project finished.
Thanks
Wayne
|
|
|
|
|
Which is the best and sure way to detect that the DLL file is a COM DLL file or it is a regular DLL file?
-- modified at 13:42 Wednesday 15th August, 2007
|
|
|
|
|
Try and register the dll using Regsvr32. If it is a com dll you would get a success message saying the dll is registered successfully. If it is not a com dll it would give you and error message saying that the entry point DllRegisterServer was not found, which means that the dll is not a com dll.
"What's on your mind, if you will allow the overstatement?"
|
|
|
|
|
Thanks,
I suppose that I could use GetProcAddress for DllRegisterServer and DllUnregisterServer
|
|
|
|
|
Hi all,
I am working on a dialog-based MFC application, which consists of multiple property pages. From one of the property pages, I am trying to launch a dialog box which contains an ActiveX control.
This is currently not working and the application exits with an access violation error when I call DoModal for the dialog. On debugging, I see this is due to AfxGetThread() returning NULL in AfxOleInit(). This does not happen if I launch the dialog-box from the application's InitInstance() function instead of a property page or if I add the control to the property page itself. I have made sure that the control is registered and that I call AfxEnableControlContainer() from the application's InitInstance() function.
I am using Visual Studio C++ .NET.
Is there something else that I have missed? Any help is greatly appreciated.
Thanks,
Priya
-- modified at 6:46 Thursday 16th August, 2007
|
|
|
|
|
Is OLE as applicable as of now in terms of its support and are there others technologies that do an exact override of the functionality in OLE.
|
|
|
|
|
tom groezer wrote: Is OLE as applicable as of now in terms of its support
Huh? You mean COM? COM is heavily used in Windows systems.
tom groezer wrote: an exact override
You mean different but with "similar" features. What would be the point of being different but exactly the same?
|
|
|
|
|
I've seen some codes using delete[] blah; and someone else delete blah; .
I didn't read in any book how to use them and what's difference. It's a couple of years that I'm programming and using just delete. Does any one know what is the difference and when we need to use those brackets?
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hamed Mosavi wrote: delete[] blah; delete blah; .
what's difference
Simple: If the memory was new ed with [] , use delete[] , otherwise normal delete.
delete[] calls the destructors of the elements of the array before freeig the memory, whereas delete does not.
You might get away with using the wrong one, until you are really under pressure. Then the whole sh*t will explode in your face.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|