|
Do any of these potential problems apply?
"GetLastError returns ERROR_INVALID_THREAD_ID if idThread is not a valid thread identifier, or if the thread specified by idThread does not have a message queue."
"Windows 2000/XP: This thread must either belong to the same desktop as the calling thread or to a process with the same locally unique identifier (LUID). Otherwise, the function fails and returns ERROR_INVALID_THREAD_ID."
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Did you find that information hidden in the documentation?
|
|
|
|
|
Extremely well hidden!
I'm pretty sure I find 2% of answers in my code and 97% hidden in the documentation.
The other 1% I pull out of my
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I had to do this with MMC a few years ago. I used custom messages WM_APP+n where n > 50 and posted them to the main window. My 'injected' Dll, actually a Console plugin installed an application wide Message Hook and filtered out the things it was interested in. Not an elegant solution I know and I hope you don't have to stoop to it. At least you are trying to recieve messages on your own thread not relying on MS to give your control some runtime.;)
http://msdn2.microsoft.com/en-us/library/ms644959.aspx[^]
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
|
|
That's true, although I tend to disagree.
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
What was his question & reply?
|
|
|
|
|
read the title (if it appeared you were too dumb to miss it)
|
|
|
|
|
This is the user who normally just types jibberish and has nothing better to do.
______________________
stuff + cats = awesome
|
|
|
|
|
Do you know suchon_phuong ?
|
|
|
|
|
I recognize the name. If you look at the users posts they are mostly gibberish or the most general questions in programming. I have a few people whose names tend to pop out for bad behavior, such as URGENT all the time.
______________________
stuff + cats = awesome
|
|
|
|
|
You can ask on the correct forum for C# we have a forum on the codeproject.
|
|
|
|
|
Hi,
Whenever we generate a MFC app, it generates standard skeleton and code for storing
options and MRU in the registry in the BOOL CSampleApp::InitInstance()
function.
<br />
SetRegistryKey(_T("SampleApp"));<br />
LoadStdProfileSettings(0);
The above comment suggests that options can be loaded either from INI or registry,
and by default registry is used.
How to activate the use of INI files insted of registry.
I'm using VS2005.
Thanks
--
Why buy the cow when milk is free?
|
|
|
|
|
One INI file is a standard file, you should search the MSDN or here in the CP in order to get more information on how to open, read, write and close files.
I would recommend you to use XML files instead of ini files... but this is only a matter of preferences...
If you would like to go to the XML way you should learn how to use any of the interfaces that are in the market.
Hope this helps.
|
|
|
|
|
You can easily switch to using INI files. The major problem you will have is deciding where to put them - Microsoft discourages writing into any of the C:\Program Files folders, which is where your app will usually be installed. But, once you know where you want it, switching to INI file is easy:
- Construct path to INI file:
BOOL CApp::InitInstance()
{
.
.
.
m_strProfileFilePath = "";
m_strProfileFilePath = GetModulePath();
m_strProfileFilePath += "\\";
m_strProfileFilePath += "MyApp.ini";
- Next we need to clean up MFC's default INI string:
free((void*)m_pszProfileName);
m_pszProfileName = _strdup(m_strProfileFilePath);
- Now we can use the standard profile functions in CWinApp:
WriteProfileString("FilesToAdd", "File001", "CRASH.DMP,Crash Dump,DMP File");
WriteProfileString("FilesToAdd", "File002", "ERRORLOG.TXT,Crash log,Text Document");
WriteProfileString("FilesToAdd", "File003", "MyApp.ini,INI File,Text Document");
.
.
.
|
|
|
|
|
Hi,
I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called.
Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method)
TIA,
Andy
|
|
|
|
|
Figured it out, needed to set the 'Notify' property to True.
|
|
|
|
|
You need to set the Notify property to True
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
If you add the SS_NOTIFY then the parent window will receive a STN_CLICKED notification (in a
WM_COMMAND message). You can set the SS_NOTIFY style in the control's property window by setting
the Notify property to true.
You can catch the message in the parent with
afx_msg void OnStaticClicked();
...
ON_CONTROL(STN_CLICKED, IDC_MYSTATIC, OnStaticClicked)
...
void CMyDialog::OnStaticClicked()
{
// do something here
}
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi.
Anybody know.
what's function use for convert number between binary and decimal.
|
|
|
|
|
A number is a number whether binary or decimal.
You have to define what you are trying to do before anyone will be able to help.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
Wes Aday wrote: A number is a number whether binary or decimal.
what about octal?
|
|
|
|
|
octal is so 1980s. I prefer base 7.
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|