|
I demonstrate by passing your Class pointer to your Worker thread .
Let your class be CMyClass and Worker thread function something like this
[vccode]
UINT <code>MyControllingFunction</code>( LPVOID pParam );
void CMyClass::StartThread();
{
AfxBeginThread(&<code>MyControllingFunction</code>,(LPVOID)<code>this</code>);
}
UINT MyControllingFunction( LPVOID pParam )
{
CMyClass *<code>pMainClass</code>=(CMyClass*)<code>pParam</code>;
return 0;
}
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Hello all. I have a button that loads a file dialog, CFileDialog. I'm trying that the user enters a PATH name rather than a FILE name. However, the CFileDialog only allows me to enter file names. ¿What do I have to do?
Here's what I'm doing, rather simple.
<br />
CFileDialog wndDialog(<br />
TRUE,<br />
NULL,<br />
NULL,<br />
OFN_PATHMUSTEXIST | OFN_HIDEREADONLY,<br />
NULL,<br />
this<br />
);<br />
wndDialog.DoModal();<br />
<br />
m_strDestPath = wndDialog.GetPathName();<br />
SetDlgItemText(IDC_NEWTRAN_DESTPATH, m_strDestPath);<br />
<br />
Regards,
K.K.
Only the good dies young...
|
|
|
|
|
|
|
I am tring to use the ToolTips with this tool and would like a multi-line tool tip. You Set the Tooltip with a String and I am trying to embed \r\n and such in the CString to create a larger Text Box of area for the ToolTip. My goal is that a person would not have to go to a next screen to see all the data but get an idea of what is there from a current screen. Any help
thank you
Kyle
|
|
|
|
|
Bit of a Newbie to this so bare with me...
In my Visual C++ 6 Project, I have a Form View whereby I wish to create another button dependant on results from a Database. In the OnInitialUpdate() of the form I am trying to use the Create Function - but can only generate a debug assertion Failure. Is have used this line of code:
m_Button.Create("My button", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), this, 1);
Am I doing anything obviously wrong?
Any help would be appreciated...
|
|
|
|
|
Place code like that in OnInitDialog.
Don't try it, just do it!
|
|
|
|
|
Thanks - that works a treat. Next question though, how can I create an OnClick Event Handler for this button that will distinguish between the different Buttons I have created from the original Button object?
|
|
|
|
|
blinkered wrote:
m_Button.Create("My button", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), this, 1);
it working fine here in my test project,what ASSERTION notice are you getting.Second put a valid ID of button instead of Putting ID=1
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
I have an mFC dll into which I want to use mysql. So in the projrct settings c++ tab in project options i put:
"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /
but the compiler says:
Command line warning D4002 : ignoring unknown option '/'<br />
Command line warning D4024 : unrecognized source file type 'C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include', object file assumed<br />
Command line warning D4027 : source file 'C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include' ignored
Project options now look like:
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /D "_USRDLL" /Fo"Release/" /Fd"Release/" /FD / "C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /c
used to look like the foll before i put in mysql, and it compiled fine
Thanks for helping,
sb
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /D "_USRDLL" /Fo"Release/" /Fd"Release/" /FD /c
|
|
|
|
|
ns wrote:
"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /
The compiler will attempt to interpret this as a parameter. Since there is no flag before the path name, it assumes it is a file that it needs to compile. The '/' by itself will be interpreted as an invalid parameter. If your intention is to add a folder to the list of folders to search for header files in, use:
/I"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include"
or add the folder to the include folder list in the program options.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, i have a control on my dialog which implements the IWebBrowser interface, but im having great difficulty getting dragging or copying to work from any page! As a test, im trying to drag the main google image from "www.google.co.uk". I have an example from http://www.codeguru.com/Cpp/I-N/internet/browsercontrol/article.php/c3379/[^] and that example works fine, you can drag to images to the desktop etc. The only difference i can see is that the example is in a View, and my code is in a Dialog.
Any help on the subject much appreciated!
Skute
|
|
|
|
|
How can I determine the folder where the .exe file is saved?
I must do this without the registry due to goofy security
restrictions on the PC where this app will run.
|
|
|
|
|
<br />
TCHAR lpszPath[MAX_PATH] = {0};<br />
DWORD dwResult = ::GetModuleFileName(AfxGetInstanceHandle(), lpszPath, MAX_PATH);<br />
|
|
|
|
|
Thank you!!!
That does exactly what I need.
|
|
|
|
|
You're asking for two different things there. I take "startup folder" to mean the "current directory" of the process, which doesn't have to be the same as the dir where the EXE is. If you want the current directory, call GetCurrentDirectory() .
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
|
I develope a DLL that is loaded with every instance of Internet Explorer. In the DLL, I want to handle something like "BeforeNavigate" event to get the URL user enter in the Adress Bar.
I've written this DLL before in C#. And in C#, handle this event is quite easy, just write something like:
WebBrowser browser;
browser.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandle(this.BeforeNavigate);
But now, I have to write it in Visual C++ 6.0. How can I handle this event in Visual C++ 6.0?
Hope to see your replies soon.
Thanks.
|
|
|
|
|
|
Hi,
I have a windows which accepts file names being dragged in (Drag AcceptFiles, OnDropFile..).
Everything works as intended when a file name is dropped from the explorer window or another window which has list of files/folders. However, when the user drags an image from a website, or an attachment from an e-mail and drops it on the Window, OnDropFile is called and a temporary folder/file name is given to the window. I need to recognize when this happens and alert the user - how can I recognize the folder as a temporary one - The location of the TEMP folder is dependent on the OS, but also seems to depend on the application - e.g. Outlook has its own temp folder, the browser uses another etc.
Thanks in advance for any help
|
|
|
|
|
I am not sure there is ANY way to tell whatsoever, but a first good guess, assuming an application followed the proper API would be to call GetFileAttributes and check for this bit set : FILE_ATTRIBUTE_TEMPORARY
Now, granted, I have never checked for this bit, and it would be curious to see if any 'temporary' files actually have it set or not.
|
|
|
|
|
Thanks.
I will try and see what I find.
|
|
|
|
|
I've downloaded and made the lib files of the CxImage library but I can't seem to make it work. I put the .lib in the object/library modules of the link tab in the general and input category but it still doesn't recognise the the CxImage object. Can anyone help me?
Should I write anything else in the code?
|
|
|
|
|
Why do you ask this here? CxImage has it's own article forum for these questions.
Don't try it, just do it!
|
|
|
|
|
Hi Friends
I am developing an application in VC++,wherein i want that if the system remains idle for an X amount of time then some event should be generated
But for that can somebody help me in knowing how to trap System idle time IN MFC
Thanks in Advance
VC++
|
|
|
|