|
I appreciate the help, but I've already checked, both are multi threaded.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Totally a wild guess, but what if you try linking statically?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
You mean link statically to MFC ? I can't see any options for static linking ( VS2005 )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
To whatever, MFC, the CRT.... it's just a guess, since I don't have VS2005 installed (I have the DVD right in front of me, but I guess that doesn't help much ).
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Christian,
I just created a MFC project with VS2005 and at the bottom of the "Project" menu the last item has the project properties. The MFC option is under "Configuration Properties" -> "General".
Elaine
The tigress is here
|
|
|
|
|
Does building in release mode help?
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
I need to get all sharing folders in network.I think , not sure, The NetFileEnum() not support in windows 95,98.Please tell me the solution ,it also work in windows 95,98.
Thank You.
|
|
|
|
|
Hi,
I set some breakpoint in my code:
[code]
//myfirst.h
class CMyApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMyFrameWnd:public CFrameWnd
{
public:
CMyFrameWnd();
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
//////////////////////////////////////////////////////////////////////////
#include <afxwin.h>
#include "myfirst.h"
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrameWnd;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyFrameWnd, CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrameWnd::CMyFrameWnd()
{
Create(NULL, _T("myfirstMFC"));
}
void CMyFrameWnd::OnPaint()
{
CPaintDC dc(this); //here I can't understand!!
CRect rect;
GetClientRect(&rect);
dc.DrawText(_T("MFC"),-1,&rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
[/code]
and I see the context in the call stack window just like below:
---------------------------------------
CWnd::OnWndMsg(unsigned int 129, unsigned int 0, long 1244260, long * 0x0012fb1c)
CWnd::WindowProc(unsigned int 129, unsigned int 0, long 1244260)
AfxCallWndProc(CWnd * 0x023e4ed8 {CMyFrameWnd hWnd=0x00100552}, HWND__ * 0x00100552, unsigned int 129, unsigned int 0, long 1244260)
AfxWndProc(HWND__ * 0x00100552, unsigned int 129, unsigned int 0, long 1244260)
USER32! 77e2158f()
USER32! 77e1c19d()
USER32! 77e122c5()
NTDLL! 77f91baf()
USER32! 77e064b5()
BCCORE! 0c067fa0()
CFrameWnd::Create(const char * 0x00000000, const char * 0x004f001c, unsigned long 13565952, const tagRECT & {top=-2147483648 bottom=0 left=-2147483648 right=0}, CWnd * 0x00000000 {CWnd hWnd=???}, const char * 0x00000000, unsigned long 0, CCreateContext * 0x00000000)
CMyFrameWnd::CMyFrameWnd()
CMyApp::InitInstance()
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00132f73, int 1)
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00132f73, int 1)
WinMainCRTStartup()
KERNEL32! 77e88989()
---------------------------------------
in the call stack window I can relatively clearly see a MFC-based Application programe is how to execute:
While the problem is:
I don't know what's KERNEL32! 77e88989()mean
and I don't know how the Message Map is occur?
who I help me??
shanzy
|
|
|
|
|
shanzy1980 wrote:
I don't know what's KERNEL32! 77e88989()mean
It means a call to the Kernel32 dll, I believe. Something you don't have source for. ( You have the MFC source, you see ).
shanzy1980 wrote:
and I don't know how the Message Map is occur?
The CWnd class wraps a Win32 message loop, MFC is just a Win32 wrapper, after all.
shanzy1980 wrote:
CWnd::OnWndMsg
That looks suspiciously like the place that Windows messages end up.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you,let me think for a while
shanzy
|
|
|
|
|
I want to share the folder programatically .please tell me how it is possible .
Thank you.
This allows you to set your preferences for the discussion boards
|
|
|
|
|
I need to update a global variable that gets manipulated in InitInstance() and a wrapper function. The variable is initialized to FALSE in the main constructior but gets set to TRUE in the wrapper function. Both threads are reading the variable in InitInstance causing a race condition.
How can I grant priority to the thread that belongs to the wrapper class? I created a mutex in the main constructor for all threads to access. In the wrapper function, I have the following code:
STDMETHODIMP CWrapper::StartApplication(DataNotificationType notifyType, VARIANT data)
{
HANDLE openMutex;
openMutex = ::OpenMutex(0, FALSE, "notify");
DWORD dwMutexErr = GetLastError();
if (dwMutexErr == ERROR_FILE_NOT_FOUND)
AfxMessageBox("cannot open mutex");
else
{
WaitForSingleObject(mutex_handle,INFINITE);
variableToUpdate = TRUE;
}
....execute some program.exe....
ReleaseMutex(mutex_handle);
}
BOOL CMainApp::InitInstance()
{ .....
if (variableToUpdate)
{
....code...
}
}
Thanks!
|
|
|
|
|
elephantstar wrote:
How can I grant priority to the thread that belongs to the wrapper class
Maybe use an event instead of a mutex that blocks your low prio thread, and only set the event when the wrapper class thread is done ?
~RaGE();
|
|
|
|
|
I created a mutex to make sure only one instance of the app in running. The variable that needs to be updated determines whether or not to create the mutex. Right now, that variable is being set to TRUE in the wrapper class. Once it's set to TRUE, CreateProcess is called to run the app within the wrapper function at the same time the main app is also running and reading in the variable that was initially set to FALSE. How would I create an event in InitInstance to run the second thread that will call InitInstance via CreateProcess? I'm just a little confused how all this works. I didn't think about using events or a mutex for synchronizing the variable until I removed my AfxMessageBox code that was used for debugging purposes. I guess it put a delay in the thread causing it to read the desired variable value.
|
|
|
|
|
HI~~
i have a Q about analyse a string type of CString.
the string was <伯 YはY><夷 YいY><叔 YしゆY><斉 YせいY><餓 OウO K哀K>于<首 YしゆY><陽 YやうY>之<下 YもとY O二O K亜K M。M>
i want get the CStringList list;
list[0]=伯;
list[1]=夷;
list[2]=叔;
.....
code like this:
while(!ado.pRtr->adoEOF)
{
var=ado.pRtr->GetCollect("SHOMON_BUN");
m_Text=(LPCSTR)_bstr_t(var);
int len=m_Text.GetLength();
while(!len==0)
{
//i don't know how can i do
}
list.AddTail(m_Text);
ado.pRtr->MoveNext();
}
thanks in advance very much~~!
nothing
|
|
|
|
|
ebinaini wrote:
i have a Q about analyse a string type of CString.
the string was...
What is it that you are wanting to analyze?
ebinaini wrote:
while(!len==0)
What are you trying to check for here?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Just curious, but when would this occur?
I figure typically it would be caused by a faulty harddrive like a bad sector which hasn't been flagged as such by defrag or scandisk???
I am way off or dead on???
Just curious, thanks
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
You are off by a couple of light years.
_lseek() will fail if it has a bad file descriptor or you try to position the file pointer before the beginning of the file. (Note: this means that positioning the file pointer beyond the end of the file is perfectly ok)
fseek() behaves similarly, but there are caveats depending on the open mode.
|
|
|
|
|
Hockey wrote:
Just curious, but when would this occur?
I figure typically it would be caused by a faulty harddrive like a bad sector which hasn't been flagged as such by defrag or scandisk???
... or if somebody pulls out the floppy disk.
Seriously, network drives are not always reliable.
|
|
|
|
|
Hi
I'm new to MFC programming but i also managed to write a small program which i would like to use as a standalone exe.
When i tried to run the program on another computer i got an error that it does not have "MFC71.dll" but i found that it has the "MFC40.dll".
My program was built using Visual Studio 2003 and i ask how can i build the project within to support the older version of MFC?
Thanks a lot
Mamtz
|
|
|
|
|
mamtz wrote:
My program was built using Visual Studio 2003 and i ask how can i build the project within to support the older version of MFC?
It's not a question of "supporting an older version of MFC". An MFC app built with VS 2003 requires the presence of MFC71.dll unless it is statically linked with MFC, in which case the DLL isn't required.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I bought a harddrive enclosure that has a button on it for one touch backup. The software that came with is sucks, so i wrote my own. How do i detect when the button it pressed. Would this be part of the device driver? Is it in the registery?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
That's not very easy.
You have to find a way to listen for messages coming from the device. A device driver is one possibility, but there may be also one for user-mode.
There are some programs on the internet which are watching the data sent through the USB port, maybe they can help you identifing the backup button message.
Don't try it, just do it!
|
|
|
|
|
Anybody have any idea how to capture and ultimately cancel when a user double clicks on the caption bar of a Frame. The Onsize is too late, OnLDoublClick doesn't get called. I don't want the user to be able to size the window, which I've accomplished by removing the WS_SYSMENU & WS_THICKFRAME from the window style. But by double clicking on the caption bar the window goes to a 'smaller' size. My app still needs the caption bar, so removing that isn't an option. Any Ideas, thanks
Larry
|
|
|
|
|
did you have a look at the "Nonclient-Area Message Handlers" ( OnNcLButtonDblClk in particular ) ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|