|
sudeep_br wrote: ...but when i go to class wizard and then to member variable name i only have cstring as variable type option apart from int, bool etc. theres no option Cedit. what should i do?
Change the Category from Value to Control.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi all ,
i want to get the path for ping.exe which will be in \\Windows\\System32\\Ping.exe but i cant specify a particular drive(C,D...) because the OS can be installed in any drive.I need to get the exact path of ping.exe .
Please suggest me how do i look for it.
|
|
|
|
|
|
|
hi all
I am not able to find the short cut keys which enables us to toggle from workspace window to .cpp window ..in VC IDE.
Does anyone know please?
redindian
|
|
|
|
|
to go to Solution explorer Ctrl + Alt + L
to go to resource view ctrl + shift + e
|
|
|
|
|
I have a visual c++ program, it worked nicely for data processing.
Recently I added a edit box and add more code in the "next" subroutine.
The program is complied and generated *.exe successfully. This routine
should be invocated by pressing "Next" button.
Now when I run the program and push the "Next" button, I got:
<data_proc mfc="" application="" has="" encountered="" a="" problem=""
and="" needs="" to="" close.="" we="" are="" sorry="" for="" the="" inconvenience.="">
I tried to display some variable values at the right beginning of
the subroutine Next, it seems the program even not reach the point.
I do not know how to fix this. I need a help.
Thanks
-- modified at 23:56 Sunday 9th April, 2006
|
|
|
|
|
hi there
paste the code which is called in the event handler ..
redindian
|
|
|
|
|
#include <string>
#include "stdafx.h"
#include "data_vib_proc.h"
#include "feature_display.h"
#include "data_vib_procDlg.h"
#include "test_window.h"
#include "cmath"
using std::string;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CData_vib_procDlg dialog
CBlast_vib_procDlg::CBlast_vib_procDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBlast_vib_procDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CData_vib_procDlg)
m_linklist_file_Name = _T("");
m_monitors_coord = _T("");
m_output_file_name = _T("");
m_seed_waveform_input = _T("");
m_predicted_waveform_output = _T("");
m_prediction_monitor_no = 1;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
....
....
....
void CData_vib_procDlg::Next()
{
FILE *f_ptr1;
FILE *f_ptr2;
FILE *f_ptr3;
FILE *f_ptr4;
FILE *f_ptr5;
const int MAX=15;
CString title_seed_file;
// ifstream f_ptr3;
float f0 = 30.0;
int nz,nz1,ndeck2;
float ppv_pred, ppa_pred, pi = 3.1415926f;
char buffer[MAX];
CBlast_vib_procDlg rr;
feature_display ff;
test_window twindow;
// TODO: Add your control notification handler code here
//
twindow.m_test_variable = int(1.5);
twindow.DoModal();
UpdateData(false);
UpdateData();
if(m_linklist_file_Name == "" || m_monitors_coord == ""||m_output_file_name=="" || m_si_waveform_input == ""||m_predicted_form_output=="")
{
MessageBox("All file names have to be typed in !");
rr.m_linklist_file_Name = m_linklist_file_Name;
rr.m_monitors_coord = m_monitors_coord;
rr.m_output_file_name = m_output_file_name;
rr.m_si_form_input = m_si_form_input;
rr.m_predicted_form_output = m_predicted_form_output;
rr.m_prediction_monitor_no = m_prediction_monitor_no;
rr.DoModal();
UpdateData(false);
}
// open linklist data file
if((f_ptr1 = fopen(m_linklist_file_Name,"r")) == NULL) {
MessageBox("Linklist file open problems !");
rr.m_linklist_file_Name = m_linklist_file_Name;
rr.m_monitors_coord = m_monitors_coord;
rr.m_output_file_name = m_output_file_name;
rr.m_si_form_input = m_si_form_input;
rr.m_predicted_form_output = m_predicted_form_output;
rr.m_prediction_monitor_no = m_prediction_monitor_no;
rr.DoModal();
UpdateData(false);
}
// open monitor coordinates data file
.....
.....
|
|
|
|
|
Set a breakpoint in the Next() method and single-step through it from that point.
mrby123 wrote: twindow.DoModal();
Is this dialog displayed?
mrby123 wrote: UpdateData(false);
UpdateData();
Consider removing these. Used incorrectly, which it looks as though they are, can lead to all sorts of unwanted problems.
What does the message map for CData_vib_procDlg look like?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I tried to set-up a breaking point inside "Next", but the program did not go that far (even the breaking point at the beginning of the "next") and stoped to give the error message.
I am thinking some of the array size in the program is too big causing overflow. That may be the problem.
|
|
|
|
|
mrby123 wrote: I tried to set-up a breaking point inside "Next", but the program did not go that far
Does the "Next" button have an ON_BN_CLICKED() handler? What does the message map for CData_vib_procDlg look like?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
here is the message-map:
BEGIN_MESSAGE_MAP(CData_vib_procDlg, CDialog)
//{{AFX_MSG_MAP(CData_vib_procDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDNext, Next)
ON_BN_CLICKED(IDExit, OnExit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
|
|
|
|
|
Hmmmm, if you've set a breakpoint in the Next() method and it is not being hit, I do not know what the problem is.
You mentioned something about an array. Does your program have them? Are they on the stack or the heap?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Now I found the array size is too big (global array - stack ?)
I get into the Next subroutine. I put a few breaking point and I checked the reading
all right.
However, I got:
"Debudg assertion failed."
what is the problem and how to fix it ?
Thanks
|
|
|
|
|
mrby123 wrote: Now I found the array size is too big (global array - stack ?)
How is it declared? How large is it?
mrby123 wrote: I get into the Next subroutine.
What statement?
mrby123 wrote: However, I got:
"Debudg assertion failed."
what is the problem and how to fix it ?
That's hard to say without knowing what line of what file asserted.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Are there any necessary apis that I should know?
I think my question was too short to understand. I want to disable internet using(such Web browsing,Chat or anything using internet) by press a button and can use internet again by press another button.
I want to know how to stop internet in windows 98.
I'm not good at English sorry.
-- modified at 3:18 Tuesday 11th April, 2006
|
|
|
|
|
What is an "apis?" What are you wanting to know?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
T532 wrote: Are there any necessary apis that I should know?
actually what you want ot do.. close internet connection or something else, if internet connection hook InternetDial api
|
|
|
|
|
DEF Files seem to have gone out of fashion. Where do I find an Authorative account for Syntax and Options.
Immediate Needs: Shared Data Sections in a DLL
A Forwarder DLL:
'MyApi=ANOTHERDLL.?PrivateMyApi@@YAKKKKK@Z'
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: DEF Files seem to have gone out of fashion.
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have seen your See Here, and read all that, What it does not explain is the Syntax of Forwarding a Function. DEF Files seem to have gone out of fashion to the extent that the only help the IDE gives, is, (in my version anyways), that All you can do in a DEFFile, can be done better by using command line options for the Linker/ Compiler. I know that not to be the case, but hence my question.
LateNightsInNewry
|
|
|
|
|
I want to draw a bitmap,(droughts for example)on dialog,
at mouse's coordinate when it's pressed !
Could you help me !
Lgx
|
|
|
|
|
This is Not a simple Problem, and a Full solution for your own custom application will resort to a long list of API's
The Outline would be as follows:-
-Create a Dialog with a Bitmap Resource in it.
-Assign a Bitmap
-In the Dialog, implement the OnPaint Method to paint the Bitmat,taking account of where you want it painted.
-Use the WM_MOUSEBUTTON messages to capture the mouse when it is clicked over the immage
-Use the WM_MOUSEMOVE messages to track the mouse, and to issue WM_PAINT messages to keep the image following the mouse.
(The Latter is not as simple as it seems)as you will discover.
You will also see that the easier UpdateWindow Call does not work for this in a dialog, it only sends a WM_PAINT after you finally release the mouse button.
As I said, Not a simple task, there is not a single API available that does the lot, Also, not a task for beginners(Choose something simpler, i.e. Move the Image to where the mouse was released, without dragging), at the same time, we all have to start somewhere. The prize is, that when you master this, you have learned a lot about the Windows API.
Let me know how you get on
Regards
LateNightsInNewry
|
|
|
|
|
thank you !
i am studying to build a program that play chess(or gomoku) over LAN !
i will build it step by step !
there are very much so program !
when you click mouse on coordinate(x,y) on the board,
drought (stone) will paint !
i want also do that !
have you ever done that ?
Lgx
|
|
|
|