|
The class must be derived from CWinThread and must override the method
BOOL CreateThread(DWORD, UINT, LPSECURITY_ATTRIBUTES);
and when passing the runtime class of class use the macro RUNTIME_CLASS(classname)
much better, unless you really need it, use the AfxBeginThread() to execute a function and pass the class object's pointer as the function's parameter.
if you have VC++.Net then read these links in the msdn
ms-help://MS.VSCC/MS.MSDNVS/vccore/html/_core_Multithreading.3a_.Creating_Worker_Threads.htm
ms-help://MS.VSCC/MS.MSDNVS/vccore/html/_core_Multithreading.3a_.Creating_User.2d.Interface_Threads.htm
|
|
|
|
|
First of all I am a usual VisualC++ developer, the problem which I am discussing is out of my hands.
While I was developing program in Visual Studio 6.0, I got erorr within the IDE that 'CANNOT EXECUTE PROGRAM'. I am getting this ERROR in the start of BUILD, what I mean that the VisualC++ compiler doesnot look for any syntax or file inclusion error, it simply spits out 'CANNOT EXECUTE PROGRAM'.
I have done my every effort from executing the VCVAR32.BAT to installing/uninstalling the VisualC++ also the VisualStudio IDE, but I am getting this problem continously.
Please anyone have any idea, how to solve this problem related to VisualC++ 6.0 or Visual Studio 6.0
Dammy More
|
|
|
|
|
Hi,
I am looking for the ultimate book on MFC...
any ideas?
|
|
|
|
|
|
Prosise - Programming Windows with MFC
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
hello all,
I have a little problem
i want to detect if the result of operation is exact :
for(int i=0;i<400;i++)
{
Pixel[i] = GetPixel(dc,CursorX,CursorY);
CursorX++;
if ((i / 20) == ???
}
if i==20, i get an exact result, if i==40....
you know how can i detect this ??
|
|
|
|
|
if (i%20==0){ }
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thx you !
the modulo of course !
|
|
|
|
|
You need to test whether your division delivers a remainder of value 0.
So you can either use the % operator, which returns 0 when an division succeeded without remainder. The second possibility is using div , returning a struct of type div_t containing the remainder, too.
|
|
|
|
|
thx for your answer
Schlaubi wrote:
So you can either use the % operator
this solution is perfect.
i don't need the result, i need only to know if the result is exact.
thx
|
|
|
|
|
I work on a program that involves zooming areas under the mouse cursor from the desktop window.
I capture the DC of the desktop using GetDesktopWindow() and GetWindowDC(). The problem is that when their exist a transparent window (WS_EX_LAYERED and any alpha level less than 255) under the cursor, the window does not appear in the DC and instead the windows below it appear as if does not exit.
Below is general view of my code:
<br />
HDC hDeskDC;<br />
HWND hDeskTop = GetDesktopWindow();<br />
hDeskDC = GetWindowDC(hDeskTop);<br />
HDC hTempDC;<br />
<br />
hTempDC = GetDC(hWnd);<br />
<br />
StretchBlt(hTempDC, 0, 0, 49, 49, hDeskDC, point.x - 3, point.y - 3, 7, 7, SRCCOPY);<br />
.<br />
.<br />
.<br />
ReleaseDC(hDeskTop, hDeskDC);<br />
I need to know how to get the desktop DC including any transparent windows on it. Some programs do it like the Accessability Magnifier comes with Win2k and WinXP.
|
|
|
|
|
I need to solve a strange problem. I need to open a file for reading&writing,
keep it open and read it by another application.
I made it under VCE (C++ for WCE) and it works. The excerpt of code is as follows:
CFile m_TheFile;
BOOL m_bIsOpen;
// Creates a File for writing and sharing readings
m_bIsOpen = m_TheFile.Open("C:MYFILE.txt", CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite , &m_ex);
// Last parameter must be null in VCE
// m_bIsOpen = TRUE (VCE & VC++)
CFile TheFile;
BOOL bIsOpen;
// THIS WORKS in VCE -> I can Open and Read the file but not in VC++
bIsOpen = TheFile.Open("C:MYFILE.txt", CFile::modeRead , &m_ex);
// Last parameter must be null in VCE; bIsOpen = TRUE (VCE)
// bIsOpen = FALSE (VC++)!!!! WHY???
// Error during access to C:MYFILE.txt///////////////////////////////////
Can someone tell me the explanation or a solution to this problem?
MANY THANKS
|
|
|
|
|
Is it simply that the current directory is not where "C:MYFILE.txt" is located??
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Unfortunately not! I can read it if I skip the first reding operation.
There has to be something stupid under it or something else more complicated!
Anyway I sent the code to your email address so as you can examine it if you want. THANKS
|
|
|
|
|
In the second Open add shareDenyNone. ie. CFile::modeRead | CFile::shareDenyNone Also check the CFileException.m_cause and see what it complains about.
FYI I didn't receive any email from you.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
OK, you solution of adding the flag CFile::shareDenyNone works!
Thanks for your advice which was really useful.
|
|
|
|
|
I'm trying to use common control in a simple program, but it seems like the linker did not recognize the INITCOMMONCONTROLSEX. I've included "commctrl.h" and comctl32.lib. I've also checked the path to my library directories and include directories, they all look fine.
Can anybody help please?
FYI: I'm using Visual Studio .NET.
Thanks a lot.
|
|
|
|
|
Hi
You probably did this already but I was getting the same linker error until I right clicked on the project under solution explorer, went to configuration properties, then to the Linker folder, then to Input, and under the additional dependencies, I typed in comctl32.lib. That seemed to solve the problem. I also had a problem when I included the header file twice in two different files of my program.
HTH
Nitin
|
|
|
|
|
hello,
i'm still making a server/client program, the database will be located on the server. Now i've come this far that i know that wenn i use Microsoft ActiveX Data Objects (ADO) i can make multible connections to the database, and it's also much faster.
But can i relay on (for example)record-locking with Microsoft ActiveX Data Objects (ADO) so the data can't be alterd while it's in use by someone else? Or do i have to make myself an class between server and database that manages these things?
Greetz,
Willem
[]D [] []D []
|
|
|
|
|
How can I temporary disable the minimize button in my MFC dialog application?
|
|
|
|
|
Try
ModifyStyle(WS_MINIMIZEBOX, 0);
RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE
| RDW_UPDATENOW | RDW_ERASE);
rechi
|
|
|
|
|
Thanks, it works great, but is there a way just to disable the minimize button, not to hide it?
|
|
|
|
|
Yes, it's possible but not so easy. You have to intercept WM_NCPAINT and use DrawFrameControl to show the minimize picture as you wish.
rechi
|
|
|
|
|
Hello,
I have an application which have a file format use for its files.
In the explorer, then I display the "Properties" of a file of my application, I didn't see any information of my file. I want to put some informations in my file (version, user, description, bitmap, etc) which can be view in the explorer when the user display the properties of my files.
How I can do ? I have search in the msdn without success...
And, if someone know, how I can associate a bitmap to a file (like bmp, jpg, MAX file, etc...)
|
|
|
|
|
A good start for your problem could be reading Michael Dunn's shell extensions tutorials here on CP.
Tutorials index[^]
|
|
|
|