|
|
prefer ofstream to cfile. In both cases, try google.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Scroll up.
Thou will see a search box.
Enter "CFile" in the text box.
Press enter.
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
I am compile my project in VC++ 6.0. There is no error.After compile it shows:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\GridPenManager.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\ESCamLib.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found.
The thread 0xBAC has exited with code 0 (0x0).
The program 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\VMCGScannerAppSuite.exe' has exited with code 0 (0x0).
But program do not Run or execute.The interesting thing is that I am creating a new dialog based project as a same name "VMCGScannerAppSuite" the same thing is happened. But other project is running in VC++ 6.0 well.
can anyone tell me plz what happened....
|
|
|
|
|
Well, your application seems to start since it loads some required DLLs.
Try putting a breakpoint in InitInstance() , step through the code and see what happens.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Nothing is happened. When I pressed F5 the previous message is shown in the
Output window.
|
|
|
|
|
What are the controls you are using on your dialog ? Please, list them completely. Are there any ActiveX control or such ?
If yes, did you call AfxEnableControlContainer() in your InitInstance ?
|
|
|
|
|
There is no ActiveX control.
yea I am calling AfxEnableControlContainer() in InitInstance();
|
|
|
|
|
Any custom controls ? If yes, check that the class name is correct.
|
|
|
|
|
There is no custom control.
Actually this project is running in other computer (WIN2000,XP).
But not mine.So there is no bugs in coding.
|
|
|
|
|
Did you use of CRichEditCtrl Class on your program?
|
|
|
|
|
No...CRichEditCtrl is used...
I have just create a new dialog based project named "VMCGScannerAppSuite".
Then just build and run the project...No control is used this project...
I am little bit worried about this type of problem. Some previous projects have the same problem which was okay some day before and some of them running well.
|
|
|
|
|
See this[^] thread does solve your problem?
|
|
|
|
|
Hi.
I have created a MDI with CFormview. I also have created a form in which I want to call from the menu. How do I call this form?
|
|
|
|
|
|
Hi.
Sorry if I didn't state the problem clearly. I have a similar problem.
I created MDI derived from CFormview. Now, I want to have a new view which I have managed to create by Insert -> Resource -> Dialog -> IDD_FORMVIEW. I have changed the ID to IDD_GRAPH.
MDI created 2 menus called IDR_MAINFRAME and IDR_CVTYPE. I have modified IDR_CVTYPE to create another menu entry called 'View'. Under 'View', there is a submenu called 'Graph'. When the user click 'Graph', I want a child window to open with the new view (IDD_GRAPH). The problem is what should I code for the new view (IDD_GRAPH) to open when 'Graph' is clicked?
|
|
|
|
|
Hi,
have you read the links I gave you??? I have there posted how to create/open/manage the new views.
I have a CScrollView to have the project, and when the user makes double click in one element. It then comes the new CFormView in another window to allow the entry of advanced parameters for this concrete element. I have 4 templates (1 CScroll, and 3 different CFormViews) but up to 48 new windows are possible (one per each possible element).
Take a look on the code of function "CreateOrActivateFrame ()". This is what I use to open or set focus to an already opened "secondary" view.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Is there some way for my app to get notified that it's reconnected to the network?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Check out the ISensNetwork interface.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How do i use the button fucntion to activate the LEDS?
The source code below is for the checkbox method:
Hope to hear from you soon!
P.s: ( Im using pin 2,4,6,and 8 of the parallel port btw to connect to the LEDs)
// ParallelPortDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ParallelPort.h"
#include "ParallelPortDlg.h"
#define DATA 0x378
#define STATUS 0x379
#define CONTROL 0x37a
#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()
/////////////////////////////////////////////////////////////////////////////
// CParallelPortDlg dialog
CParallelPortDlg::CParallelPortDlg(CWnd* pParent /*=NULL*/)
: CDialog(CParallelPortDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CParallelPortDlg)
m_pin2 = FALSE;
m_pin4 = FALSE;
m_pin6 = FALSE;
m_pin8 = FALSE;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CParallelPortDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CParallelPortDlg)
DDX_Check(pDX, IDC_Pin2, m_pin2);
DDX_Check(pDX, IDC_Pin4, m_pin4);
DDX_Check(pDX, IDC_Pin6, m_pin6);
DDX_Check(pDX, IDC_Pin8, m_pin8);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CParallelPortDlg, CDialog)
//{{AFX_MSG_MAP(CParallelPortDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_TIMER()
//}}AFX_MSG_MAP
//Code added by me from here.
ON_COMMAND_RANGE(IDC_Pin2, IDC_Pin9, ChangePin)
ON_COMMAND(IDC_Pin1, ChangeControl)
//Code added by me till here
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CParallelPortDlg message handlers
BOOL CParallelPortDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here//App.Wiz generated code
// TODO: Add extra initialization here
short _stdcall Inp32(short portaddr);
void _stdcall Out32(short portaddr, short datum);
SetTimer(1,200,NULL);
Out32(CONTROL, Inp32(CONTROL) & 0xDF);
UpdatePins();
return TRUE; // return TRUE unless you set the focus to a control
}
void CParallelPortDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CParallelPortDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CParallelPortDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CParallelPortDlg::UpdatePins()
{
short _stdcall Inp32(short portaddr);
void _stdcall Out32(short portaddr, short datum);
int reg;
reg=Inp32(STATUS);
if((reg & 0x40)==0) m_pin10=0; else m_pin10=1;
if((reg & 0x80)==0) m_pin11=0; else m_pin11=1;
if((reg & 0x20)==0) m_pin12=0; else m_pin12=1;
if((reg & 0x10)==0) m_pin13=0; else m_pin13=1;
if((reg & 0x08)==0) m_pin15=0; else m_pin15=1;
//////////
reg=Inp32(DATA);
if((reg & 0x01)==0) m_pin2=0; else m_pin2=1;
if((reg & 0x04)==0) m_pin4=0; else m_pin4=1;
if((reg & 0x10)==0) m_pin6=0; else m_pin6=1;
if((reg & 0x40)==0) m_pin8=0; else m_pin8=1;
//////
}
void CParallelPortDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
// TODO: Add your message handler code here and/or call default
}
void CParallelPortDlg::ChangePin()
{
int data_register, new_register;
short _stdcall Inp32(short portaddr);
void _stdcall Out32(short portaddr, short datum);
UpdateData(TRUE);
data_register=Inp32( DATA );
new_register=0;
if( m_pin2==TRUE ) new_register |= 0x01;
if( m_pin4==TRUE ) new_register |= 0x04;
if( m_pin6==TRUE ) new_register |= 0x10;
if( m_pin8==TRUE ) new_register |= 0x40;
Out32(DATA, new_register);
}
void CParallelPortDlg::ChangeControl()
{
int control_register, new_register;
UpdateData(TRUE);
short _stdcall Inp32(short portaddr);
void _stdcall Out32(short portaddr, short datum);
control_register = Inp32( CONTROL );
new_register = control_register;
Out32(CONTROL, new_register);
}
|
|
|
|
|
Would you mind shortening this code ? specific to your "exact" probelm.
Use <pre> tags to post code.
Prasad
MS MVP - VC++
|
|
|
|
|
Do you really expect anyone to wade through all of this code? Post only the relevant portion, which is usually less than a dozen lines.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
A Class To Read from Text File(.txt) and Write to New Table in Design Visual C++
|
|
|
|