|
can someone of you to send me the code of minesweeper,c++???plz help meeeeeeeee
|
|
|
|
|
|
if you mean the source code of the minesweeper distributed with windows then we can't help you. It is not public!
Don't try it, just do it!
|
|
|
|
|
i don't mean that..i want the source code of any minesweeper.i use it for an exrecise that ask the source code of minesweeper...someone to help me??
|
|
|
|
|
Has anyone encountered an error where CreateThread fails to create a thread but does not return NULL for a thread handle? Thanks.
|
|
|
|
|
Anonymous wrote:
Has anyone encountered an error where CreateThread fails to create a thread...
What are you doing to verify that CreateThread() has failed to create a thread?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
That would also have been my first question .
But I still have an additional one: Tell us more about the problem. For example you could post a small code passage here to make it easier for us to find out what has happened.
Don't try it, just do it!
|
|
|
|
|
Hello,
I am working on a Dll that can't create more than one thread instance and thus would like to know what I can do to prevent that from happening.
Thank you.
Dave
|
|
|
|
|
dNimrod#X wrote:
...a Dll that can't create more than one thread instance...
Are you wanting only one instance of the DLL to exist, or are you wanting the DLL to only be able to create one thread, or is the DLL failing to create more than one thread and you want to know how to create additional threads?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I also don't understand what this guy wants from us. It is very unclear. Are you meaning that you just want one thread created by the dll for every process, or do you mean only one thread for the whole system?
Don't try it, just do it!
|
|
|
|
|
I'm sorry if I wasn't clear enough... Allow me to explain what I need to do:
I have to create a Dll, which is loaded at startup time and should be accessible by any application. Among many different features, this Dll creates a kind of console for output purposes only. So, all applications loading the Dll, can get direct access to this "output console" (and other features.)
My problem is I can't let the Dll get duplicated each time an app loads it.
This is why I am asking you for your help as I have never attempted to do this in a Dll. Actually I have never had this need before.
What would you suggest me to do?
Dave
BTW:
Perhaps I can prevent this from happening if all the applications use GetModuleHandle , instead of loading them?
|
|
|
|
|
Hi
Am not sure if it will work or if its the correct way.
Created a shared variable, so that this variable will be shared among the all the loaded Dll.
#pragma data_seg(".DAT")
int NumberofInstance 0
#pragma data_seg()
..
..
NumberofInstance++;
if(NumberofInstance>1)
{
Dont load the DLL.
}
in the Def file add this
SECTIONS
.DAT Read Write Shared
Hope this will help you.
Regards
Mohamed Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi and thanks for the reply!
That is exactly what I need to do. I would have accomplished it by now if it wasn't for one thing: this Dll of mine has MFC support and thus I don't have access to the DllMain procedure! I do have access to CWinApp::InitInstance . How can I prevent the Dll from loading twice?
Perhaps I'm just confusing (and confused) with all this Dll business...
|
|
|
|
|
check if this console window exists from DllMain and create it if now.
Then create an API for writing text on that window. The API should get the window handle from the console window and send messages to it which are processed then in the process context that created the window.
Don't try it, just do it!
|
|
|
|
|
I'm using the VS.Net 2003 IDE and it doesn't set up CFormView-based apps with print and print and print preview functionality. But since all the overridable member functions are there, I would like to add an event handler for my menu item that sets up the CDC and CPrintInfo members to use to call the overridden OnPreparePrinting and other functions so that I can call print preview. I tried filling in what I thought were the appropriate members of the CPrintInfo structure and calling OnPreparePrinting which, looking through the MFC source creates a printer hdc if you don't have one supplied, but it doesn't work. First of all, it ASSERTs on VERIFY(pInfo->m_strPageDesc.LoadString(AFX_IDS_PREVIEWPAGEDESC)); and even if I step over that line, nothing happens. Any help would be greatly appreciated. Thanks in advance
[insert witty comment here]
bdiamond
|
|
|
|
|
I want to load Core of Word in a MFC project.
|
|
|
|
|
Ok, so use Word Automation.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know of a macro or add-in that will take a text selection and automatically add it to the string table and replace the text with the new string table ID?
Dave
|
|
|
|
|
I want to protect my ActiveX!?
|
|
|
|
|
Hi,Dears
how can i get character in CString Object?
How can i convert information to char*?
I confuse between this type of data!
Thanks for your attention.
best regards.
MJM.
|
|
|
|
|
To get caracter use GetAt(n).
To get string as char* use (LPCTSTR)
Sample:
CString str = "Practice";<br />
<br />
char* test = (LPCTSTR)str;<br />
ASSERT(str.GetAt(0) == 'P');
Also test GetBuffer().
Don't forget to call RealeseBuffer() after GetBuffer.
CString sWinDir;<br />
GetWindowsDirectory(sWinDir.GetBuffer(MAX_PATH+1), MAX_PATH+1);<br />
sWinDir.RealeseBuffer();
|
|
|
|
|
|
|
mostafa_pasha wrote:
how can i get character in CString Object?
For a single character:
CString str('B');
str = 'A'; mostafa_pasha wrote:
How can i convert information to char*?
For what purpose? If you have a need to modify the interal CString object, use the GetBuffer() method. If modification is not necessary, simply use the LPCTSTR operator.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i do not have a need to modify. but there is some way i copy this to
heap that i create with HeapAlloc ?
|
|
|
|