Well no much more to add, that's the question : Wich is the best way to launch/run an externall .exe app form vc++6 ? When I say the best I'm thinking in the best balance between simplicity and functionality. Thanks in advance. Any examples if it's possible.
timbk
Posts
-
Wich is the best way to launch/run an externall .exe app form vc++6 ? -
How to bring an App to front, from another AppNow i get these error messages from compiler:
error C2065: 'GetProcessID' : undeclared identifier
error C2065: 'hInstace' : undeclared identifierI can't find a the equivalent instruction in VC++6 for
GetProcessID
-
How to bring an App to front, from another AppOk, it's working for the app1 that I know his title, let say from the "Switcher" app it's possible bring the other app1(the one i know his title) behind the Switcher, but with the other app2 , (wich is no-modal dialog) it doesn't work , i do not know the name of his class and the dialog it has not title, so i went whith the code that you wrote, but compiler complains with ProcIDFromWnd, it says that is undeclared identifier, it seems that is not a valid intruction for VC++ 6 , ?? Anyway , since in the final projet will be runnig only these three apps, i thoth that the Switcher can bring the app 1(the one working) behind it and send it to bottom when the user wants to see the app2, mfc library says that it's possible to use the parameter HWND_BOTTOM instead hWndSwitcher in
SetWindowPos(hWndTarget, hWndSwitcher, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
to do that, but it's doesn't work neither. What do you think? -
How to bring an App to front, from another AppThanks, So I have to use this instruccion SetWindowPos(targetWindow, switcherHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); on my "Switcher" dialog, ok, my last doubt is how can I get the handler to the target window from the "Switcher" dialog?
-
How to bring an App to front, from another AppHello , I'm programing in VC++ 6, and the entire project runs in a computer without keyboard but with touch screen. The thing is that a have two app runnig at the same time, and I want the user to be able to switch between these apps by touching in a third app (called "Switcher",wich is always on top), this third app is a dialog based app, dialog's size is small and it has only two buttons, one for bring the first app to front and the other button to bring to the second app. The project has to run over win 98 an over win XP. How can i do to get wich app is The "Switcher" and bring the other to front but under the "switcher"?
-
how to Read/Write to a file a structure wich contains Cstring ?Ok, thanks , i will check it, very usefull. But for the other data types is it ok to save data i as described before? , I mean pherhaps is not the elegant way but it's working (not with CString), as I have to finish this work for tomorrow I was hoping there was a easier way, I only have to store some few words.
-
how to Read/Write to a file a structure wich contains Cstring ?Hello, I have to Write/read a file with a structure wich contains CString data, if drop out the CString data from the structure it works but if I left the CString data the program crashes when attemps to read. Here the structure
struct MyStructure
{
CString label//For others data types char, BYTE, etc it works but for CString it doesn't
unsignet char data1
BYTE data2
}the writing
struct MyStructure Estructura; CFile FileConfig;
FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite);
FileConfig.Seek(0,CFile::begin);
FileConfig.Write(&Estructura,sizeof(Estructura));
FileConfig.Close();the reading
struct MyStructure Estructura; CFile FileConfig ;
FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeRead);
FileConfig.Seek(0,CFile::begin);
FileConfig.Read(&Estructura,sizeof(Estructura));
FileConfig.Close();What I'm doing wrong, may be is something in relation with CString size, but I'm not sure. And the file has to be a .dat file because is modification to an older application.
-
User defined message , exeption at the handler return [modified]The ecxeption is a first chance exception :First-chance exception in MyApp.exe (MFC42D.DLL): 0xC0000005: Access Violation. The app runs without any exception, but after the PostMessage is sent to the parent dialog , the child dialog do some things wrong , dones't work fine, but there isn't any errors messages.
-
User defined message , exeption at the handler return [modified]When the exception comes up, i have this debug log:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\inpout32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MFC42D.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSVCRTD.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\Archivos de programa\Internet Download Manager\idmmkb.dll', no matching symbolic information found.
Warning: dialog data checkbox value (2117840950) out of range. //I can't find why , all checkboxes seems ok.
Warning: dialog data checkbox value (1598735280) out of range. //I can't find why , all checkboxes seems ok
First-chance exception in Calibracion.exe (MFC42D.DLL): 0xC0000005: Access Violation.Look at the warnings about checkboxes , there were a lot more , but once i saved the file generated by Myapp, all these checkboxes warnings desappeared , but these two not, i can't find them. Another thing , when the exception comes up the debugger jumps to a asembler code :
5F430BE2 call dword ptr [eax+98h] // jump to this line.
5F430BE8 test eax,eax
5F4 -
User defined message , exeption at the handler return [modified]«_Superman_» wrote:
Use WM_APP + 1 instead of WM_USER + 1.
Thanks for your answer, I did what you said, but i get the same exception.
-
User defined message , exeption at the handler return [modified]Maximilien wrote:
timbk wrote: afx_msg void OnMsjGuardarConfig(); shouldn't that be : LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);
Ok , I tried with this:
LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);
instead of
afx_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);
and besides :
afx_msg void OnMsjGuardarConfig();
instead of
afx_msg void OnMsjGuardarConfig();
Is this what you meant? No erros compiling, but I get the same exception.
-
User defined message , exeption at the handler return [modified]Cool_Dev wrote:
timbk wrote: //i do some stuffs what are the stuffs you do there?
At the moment nothing , all code inside es comented, so this is how it looks now:
LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam)
{
return 0; // ==> here is the exception !!
}Cool_Dev wrote:
timbk wrote: afx_msg void OnMsjGuardarConfig(); what is this meant for, though it may not be the reason for your problem.?
I'm not sure to understand very weel this question, but anyway , this piece of code that you quote is in the header file of parent dialog let say's MydialogDlg.h :
. .
protected:
HICON m_hIcon;// Generated message map functions //{{AFX\_MSG(CCalibracionDlg) . . afx\_msg void OnSetfocusEditSens7(); afx\_msg void OnSetfocusEditSens8(); afx\_msg void OnConfiguracion(); afx\_msg void OnMsjGuardarConfig(); . . //}}AFX\_MSG DECLARE\_MESSAGE\_MAP()
-
User defined message , exeption at the handler return [modified]Hello, Im using a dialog based app (VC++ 6), with a main dialog and his child dialog (modals dialogs). And i have to use a user defined message to send a message to the parent dialog. When i'm debugging, in the handler of this message (in the parent dialog) i get this exception in the return sentence "Unhandled exception in Myapp.exe (MFC42D.DLL):0xc0000005: Acces Violation Parent dialog header, declaration of Handler:
. . afx\_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam); . .
Parent dialog header, Declared Mesagge map:
. . afx\_msg void OnMsjGuardarConfig(); . .
Parent dialog source, file Message map:
. . ON\_MESSAGE(WM\_MsjGuardarConfig, OnMsjGuardarConfig) . .
Parent dialog source, file definition of the handler:
LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam)
{
//i do some stuffs
return 0; // ==> here is exception !!!!
}Defining the user defined message in StdAfx.h:
. .
#define WM_MsjGuardarConfig WM_USER+1 //
.
.Posting the message in the child dialog:
void CConfiguracionDlg::OnBUTTONGuadar()
{
GetParent()->;PostMessage(WM_MsjGuardarConfig,NULL,NULL); //
}Probably is some newbie problem , but i can't fix it until now. :( Thanks in advance!!
modified on Friday, December 10, 2010 10:25 AM
-
Spin control , it's possible to know when the control is released?:-D thanks for your time Code-o-mate :thumbsup:, finally google and 5 hours of work give me the solution, one of them at least. This how it looks now: Header file
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
Source file Message map
ON_WM_VSCROLL()
And handler
void CCalibracionDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if(SB_ENDSCROLL == nSBCode)
{
if(pScrollBar->m_hWnd == m_Spin1m_hWnd)
{
// the position was not changed, so...
AfxMessageBox( _T("Termino el Spin1!!!") );
return;
}
if(pScrollBar->m_hWnd == m_Spin2.m_hWnd)
{
// the position was not changed, so...
AfxMessageBox( _T("Termino el Spin2!!!") );
return;
}
}
} -
Spin control , it's possible to know when the control is released?Ok, sorry if my questions are too basics, so I already add the class CMyspin to the proyect as you decribed, and i added a control variable " m_Spin1" of CMySpin type to the spin 1 control , compiled with no errors, so wich is the next step? how can i catch the event of control released?
-
Spin control , it's possible to know when the control is released?Ok, thanks a lot for your time, yes it's easier in VS2003, but is not my choice to use VC6 , i have to, so i gonna keep searching.
-
Spin control , it's possible to know when the control is released?Thanks for your answer, ok I've trying, I did this: In the header file CalibracionDlg.h
afx\_msg void OnDeltaposSPIN1(NMHDR\* pNMHDR, LRESULT\* pResult); afx\_msg void OnReleasedCaptureSPIN1(NMHDR\* pNMHDR, LRESULT\* pResult);
In the source file Calibraciondlg.cpp
ON\_NOTIFY(UDN\_DELTAPOS, IDC\_SPIN1, OnDeltaposSPIN1) ON\_NOTIFY(NM\_RELEASEDCAPTURE, IDC\_SPIN1, OnReleasedCaptureSPIN1)
and the methods
void CCalibracionDlg::OnDeltaposSPIN1(NMHDR* pNMHDR, LRESULT* pResult)
{NM\_UPDOWN\* pNMUpDown = (NM\_UPDOWN\*)pNMHDR; // TODO: Add your control notification handler code here //some code
}
void CCalibracionDlg::OnReleasedCaptureSPIN1(NMHDR* pNMHDR, LRESULT* pResult)
{
GetDlgItem(IDC_SPIN1)->EnableWindow(FALSE);//just to see if it works.
}the compiler doesn't show any erros, but when I execute , nothing, when the control is released nothing happens. may be i forgot something?
-
Spin control , it's possible to know when the control is released?I'm not sure to understand what you mean, perhpas because I'm newbie :( . I looked for ON_NOTIFY and the unique reference is:
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN1, OnDeltaposSpin1)
no references for NM_RELEASEDCAPTURE,of course inside of commctrl.h i can find this line that you posted:
#define NM_RELEASEDCAPTURE (NM_FIRST-16
but I don't know what to do with this, can you explain a little more?
-
Spin control , it's possible to know when the control is released?hello, i'm using vc++ 6 , in my app i need to do some things when the spin control is released, but in vc++6 there is only two events for this control: UDN_DELTAPOS and NM_OUTOFMEMORY, no events for control released, i've been reading that in .net 2003 there is a event NM_RELEASEDCAPTURE in order to do this, but how can i do this in VC++6?
-
how to don't allow interruptions in a piece of code in VC++there is a thread running in at the same time the main thread, this new thread created for the acquisition is always checking the state of a bit in status register to know when there is a valid data present in data register, so do you think that is not a good idea to set a realtime priority to whole thread? I'm not using interuptions, i dont know how to do this in Win98 , it's possible handling interuptions in Win98??