|
Are you using MFC and custom message handling (ON_MESSAGE, ON_REGISTERED_MESSAGE) at all?
If so, check that your handler functions for those messages are declared
afx_msg LRESULT funcname(WPARAM,LPARAM)
and not anything else. This is a common cause of "works in debug, crashes in release".
Alternatively, modify your link properties to generate debugging information, and run the release version under the debugger. You can do this without turning off optimisations. This might help you find the area that's at fault.
Steve S
Developer for hire
|
|
|
|
|
Hi, I've to write a code to solve this problem:
"The packets form A has been received by B but the packets need to be assemble at B. Write a programming in C/C++ to reassemble the packets at B."
Can somebody help me...
Hi, I'm new in programming. Can somebody help me . . .
|
|
|
|
|
Hello,every body,
please help to tell me how to save XML as string, (I use VC++ to develop)Pug XML Parser.thanks!!!
regards
angus
angus
|
|
|
|
|
You mean Pug located here at Code Project? Did you try reading the documentation?
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
thank for your help!I use pug XML parser to set something into XML content,now I want to save the XML content as string or Blob,than I can save it in database.
i have try to use method:outer_xml(),but may be some steps wrong,please tell me the right method,thanks!
angus
|
|
|
|
|
|
In My dll, I use SetWindowHand(HWND hWnd) to get the exe program window's HANDLE, but in SDI program, when dll sendmessage to view window of exe program, the view can't recieve the message. in Dialog program, it runs well, but in SDI, it has that question, why??????
~~~
|
|
|
|
|
R u setting the windows handle from the view class? Some times the Frame wnd in the SDI app might have got the message. did u trried catching the message there?
nave
|
|
|
|
|
i try to catch the message in both view and Frame, but nothing was caught,
what's the matter???
~~~
|
|
|
|
|
What message r u sending?A userdefined one?
if ur using WM_USER + messages, try creating a message with RegisterWindowMessage() funtion...
nave
|
|
|
|
|
it can't work even;
is there any other idea???
~~~
|
|
|
|
|
I want to change the position of the button when the window size change.
How to write the code?
if (m_button)
{
m_button.SetWindowPos(NULL,intWindowWidth - 147, 11, intWindowWidth - 179, intHeight - 59, SWP_NOMOVE);
}
????
|
|
|
|
|
mimimimilaw wrote: SWP_NOMOVE
??
Do the chickens have large talons?
|
|
|
|
|
this way
m_button.SetWindowPos(NULL,intWindowWidth - 147, 11, intWindowWidth - 179, intHeight - 59, SWP_NOZORDER);
or
m_button.MoveWindow( intWindowWidth - 147, 11, intWindowWidth - 179, intHeight - 59 )
nave
|
|
|
|
|
You can use MoveWindow in wm_size
whitesky
|
|
|
|
|
i have access detail for ODLserver current API program as follow : user,acount,password,and the port no.
Now i want to make connection with server.
I have created a vc6 dialog based application which include activex control in that...now i am able to add active x in my dialog box...
My confusion is how to write a code which make connection with ODL server
|
|
|
|
|
How can we insert a new item to another program's ListCtrl control?
I do this:
LVITEM lvi, *_lvi;
char item[512], *_item;
unsigned long pid;
HANDLE process;
GetWindowThreadProcessId(myHwnd1, &pid);
process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid);
_lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE);
_item=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE);
lvi.cchTextMax=512;
lvi.iSubItem=1;
lvi.pszText=_item;
// WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);
// ::SendMessage(myHwnd1, LVM_GETITEMTEXT, (WPARAM)0, (LPARAM)_lvi);
// ReadProcessMemory(process, _item, item, 512, NULL);
lvi.iItem = 1;
lvi.iSubItem = 0;
lvi.pszText=_item;
WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);
i = (int)::SendMessage(myHwnd1, LVM_INSERTITEM, (WPARAM)0, (LPARAM)_lvi);
But there is problem when execute above, memory violate....
Who can help me??please!!!
Who can help me??please!!!
|
|
|
|
|
Hi All,
I created one MFC extension dll and loaded the exporated function in another sample
MFC SDI application on click of the toolbar events.This application is almost looks
simmilar to paintbrush where the exported functions are having the implementaion of
painting methods.The MFC sample EXE is just to call the extention DLL and call each
exported fucntion(in .DEF file of MFC Extension DLL) to test whether the actions are having or not but for one function i am getting runtime error while excuting the MFC
sample EXE i.e. "Debug Assertion Failed".
Program path of the sample MFC SDI exe......
File : wingdi.cpp
Line : 1054
I am giving following code snippets....
HDC hdc = NULL;
UINT uIntRect = 0;//RECTANGLE;
HWND hwnd = NULL;
BOOL uReturnVal= FALSE;
LPFNDLL_drawShape lpfndll_drawRectangle;
HMODULE hModule = LoadLibrary("D:\\FancyViewer\\Notebook_13July2006\\Notebook\\Debug\\Notebook.dll");
if(hModule)
{
lpfndll_drawRectangle = (LPFNDLL_drawShape)GetProcAddress(hModule,"drawShape");
if (!lpfndll_drawRectangle)
{
AfxMessageBox("GetProcAddress() method is failed");
FreeLibrary(hModule);
return;
}
else
{
CRect rect;
GetClientRect(rect);
CPaintDC dc1(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc1);
hwnd = (HWND)dc1.GetWindow();
hdc = dc1.Detach();
uIntRect = RECTANGLE;
// call the function of drawShape method for rectangle of Notebook.dll
uReturnVal = lpfndll_drawRectangle(hdc,uIntRect,hwnd);
ASSERT(uReturnVal == TRUE);
char buffer[65];
MessageBox(_itoa(GetLastError(),buffer,10),NULL,MB_OK);
return;
}
}
else
{
AfxMessageBox("Load library failed");
return;
}
GetLastError();
|
|
|
|
|
|
Is it possible to use an inherited class (CIosDialog : CDialog) as the base class in ClassWizard (instead of seeing CDialog as the base class, CIosDialog as the base class)?
Thanks.
John P.
|
|
|
|
|
jparken wrote: Is it possible to use an inherited class (CIosDialog : CDialog) as the base class in ClassWizard (instead of seeing CDialog as the base class, CIosDialog as the base class)?
Add the class as a generic class and then type in the base class name in the New class dialog.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Hello,
I am curious to know if there exist a built-in Regular expressions algorhythm in C++ that can search patterns in a file and display them on the screen?
Thanks
|
|
|
|
|
Harold_Wishes wrote: display them on the screen?
I don't believe any Regular Expression Engine will know anything about displaying results on a screen.
Harold_Wishes wrote: can search patterns in a file
It is also unlikely that a Regular Expression Engine will know about searching files.
Harold_Wishes wrote: built-in Regular expressions algorhythm
Regular Expressions are not part of the ISO C++ standard... yet. There is a Regular Expression Library in Boost (boost.org)
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
I am trying to create a dynamic string array m_pSentences[iLineCount], where iLineCOunt is the number of lines in a text file.
What should the synthax be?
Error:
(35): error C2440: '=' : cannot convert from 'char (*)[1000]' to 'char *'
Code:
char strSentence [MAX_SENTENCES_PER_FILE + 1] [MAX_CHARS_PER_SENTENCE + 1] = {""};
char strFileToRead[MAX_FILEPATH_LENGTH + 1] = {"c:\\temp\\testfile.txt"};
int iLineCount = 0;
// read the file and update temporary array
fstream file_op(strFileToRead, ios::in);
while(!file_op.eof())
{
file_op.getline(strSentence[iLineCount], MAX_CHARS_PER_SENTENCE);
iLineCount++;
}
file_op.close();
// create an array of sentences
char *m_pSentences;
m_pSentences = new char[iLineCount + 1] [MAX_CHARS_PER_SENTENCE];
for (int iIndex = 0; iIndex <= iLineCount; iIndex++)
{
strcpy(strSentence[iIndex], m_pSentences);
//m_pSentences[iIndex] = *strSentence[iIndex];
}
for (int iIndex = 0; iIndex <= iLineCount; iIndex++)
{
cout << m_pSentences[iIndex] << endl;
}
delete [] m_pSentences;
}
Jon
|
|
|
|
|
char *m_pSentences[MAX_SENTENCES_PER_FILE];
but, you'd be much better off using CString or std::string and some kind of container class:
vector< std::string > sentences;
sentences.push_back("this is sentence 1.");
sentences.push_back("this is sentence 2.");
or
CStringArray sentences;
sentences.Add("this is sentence 1.");
sentences.Add("this is sentence 2.");
messing around with multi-dim arrays is more trouble than it's worth, in most cases.
Do the chickens have large talons?
-- modified at 22:42 Monday 17th July, 2006
|
|
|
|
|