|
The issue here is self modifying code. In order to pull this off correctly I need to be able to tell the size of a code block so I don't read over it's memory bounds when copying it to another location. Yes I could just figure out the size and declare it as a constant or something, but this would have nasty results if I changed the code that was being copied and forgot to update it's size.
|
|
|
|
|
Can anyone help me with this one:
I am tying to write an application that uses separate thread to communicate with the COM port. Everything is working fine but when I try to cancel the communication by using Thread::Abort() my application just freezes. What am I doing wrong?
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
You should find a manner to cancel any pending IO on the port first, and then signal to your thread to exit. The thread will 'naturally' exit if it leaves the bottom of the function.
Just blowing off the thread will result in several problems - you migth be failing to close the port, you might be leaking memory, etc.
|
|
|
|
|
I have been trying to create a splitter pane inside a tab control but have been unsuccesful so far. Can anybody point me to simple example of splitters inside a tab control. I have seen one on code project, but its just too complicated.
a
|
|
|
|
|
|
|
Yes I've looked at that..its just too complicated for a begineer like me to understand as yet. Anything else that you might know of?
A
|
|
|
|
|
I would like to automatically launch a dialog box at start up! Where should I place the code, in the Doc or View class and which methods would be best.
Any help would be appreciated. Thanks
|
|
|
|
|
The modeless dialog needs to be a member variable, of your main window class I'd say.
Create it when the main window is created.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I have a .NET C++ compiled MDI application that is displaying discrepancy between the release and debug configurations. The application basically draws/paints a map in the client areas. I am noticing that in the debug version, the map draws fine. However, when it is run in the release mode, the map doesn't get drawn. I have added the debugging hooks in the release configuration and recompiled and notice that the map draws (behaving like the debug version - which is kind of expected). So, I am not sure where to turn - Anyone have any ideas?
Thanks-
|
|
|
|
|
hi all my dear
i want to recover Win XP dialup pass
but i cant recover it bcu its non asterisk password
plz help me to recover it
but i need a source code or a metode to recover it
plz help me
thanks & thanks
|
|
|
|
|
plz heeeeeeeeeeelp
plz
sooooon its my university project
|
|
|
|
|
Buddy
that's hacking ,if you can provide me your ubniversity project guidelines ,then i can help otherwise you have to do it by own
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
What function should I use to check if a file exists? I came across it when I didn't need it, now that I need it I can't find it. Gotta love how that works.
Thanks!
Hua-Ying
|
|
|
|
|
PathFileExists() in shlwapi.h
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
Thanks, love your signature!
Hua-Ying
|
|
|
|
|
You can also use _access() .
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks, I'll take a look at that!
Hua-Ying
|
|
|
|
|
You can also use GetFileAttributes()
You can also use CreateFile and try to open Existing
You can also use FindFirstFile
You can also use CFile
You can also use fopen
|
|
|
|
|
Hi,
I have a simple C++.net DLL test app that I am having trouble with.
The test consists of a Dialog style app which (on the press of a button) calls a function inside the DLL, which in turn attempts to open a dialog.
The dialog in the DLL does not open. The constructor is called, however the creation of the dialog returns with a minus one value. I believe this is because the runtime is looking for the dialog resource in the main app and not the dialog. I have tried multiple times to fix this, but have been unsuccessful
Can anyone help?
Below is a snippet of the code with the call to domodal. Thanks.
DLLEXPORT void PopUpaDialog(void)
{
//AFX_MANAGE_STATE(AfxGetStaticModuleState());
AfxMessageBox("Before Popping up the LVTest Dialog");
INT_PTR nResponse = 9999;
LVTest dlg;
nResponse = dlg.DoModal();
switch ( nResponse ) {
case -1:
AfxMessageBox("Dialog box could not be created!");
break;
case IDABORT:
// Do something
break;
case IDOK:
// Do something
break;
case IDCANCEL:
// Do something
break;
default:
AfxMessageBox("Default message after LVTest dialog");
break;
};
AfxMessageBox("After Popping up the Dialog");
}
|
|
|
|
|
If my memory serves me well, this is precisely the piece of magic you need so that some GUI inside a MFC extension DLL works all right. Any particular reason why you have it commented out?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Joaquín, thanks for your response.
Well, when I have that line uncommented I get a violation access error atemptign to access location zero in "dlghtml.cpp", at teh lines I have highlighted. Any ideas, or anything I might try?
BOOL CDHtmlDialog::OnInitDialog()
{
AfxEnableControlContainer();
CDialog::OnInitDialog();
RECT rectClient;
GetClientRect(&rectClient);
// if we've been created from the dynamic template
// set the caption
if (!m_lpszTemplateName)
SetWindowText(m_strDlgCaption);
// check if there is a browser control on the dialog
// already
CWnd *pCtrl = GetDlgItem(AFX_IDC_BROWSER);
LPUNKNOWN lpUnk;
if (pCtrl)
{
lpUnk = pCtrl->GetControlUnknown();
if (lpUnk && SUCCEEDED(lpUnk->QueryInterface(IID_IWebBrowser2, (void **) &m_pBrowserApp)))
{
m_wndBrowser.Attach(pCtrl->m_hWnd);
m_bAttachedControl = TRUE;
}
}
if (m_pBrowserApp == NULL)
{
// create the control window
m_wndBrowser.CreateControl(CLSID_WebBrowser, NULL,
WS_VISIBLE | WS_CHILD, rectClient, this, AFX_IDC_BROWSER);
lpUnk = m_wndBrowser.GetControlUnknown();
if (FAILED(lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &m_pBrowserApp)))
{
m_wndBrowser.DestroyWindow();
DestroyWindow();
return TRUE;
}
}
|
|
|
|
|
Ummm... I've done a cursory search on the Internet and come up with nothing conclusive. You might want to try moving the AfxEnableControlContainer(); line to your CDLLApp::InitInstance .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Hi,
I have a little problem arranging multiple toolbars in a mfc app.
I have one toolbar and 2 dialogbars we should be placed in ONE row at top of the mainframe. When I say allign top each control gets an extra row => 3.
Than I saw the docking-side-by-side article which works fine, but when I resize the app (smaller) the bars wrap. After sizing back each control has its own row => 3. Another drawback is that floating and rearranging by hand is possible. I want a fixed layout! The user isn't allowed to change the position of the bars!
So, I hope you can help me. I must be a little flag or something but I can't find it.
Thnx.
|
|
|
|
|
hi
i need to hide my logical disk "c:" compeletly
not only in windows explorer but compeletly denied any access to it not on network only but alse on my computer .
please some source code.
more Thannks .
|
|
|
|