|
- Add a few message boxes in ::InitInstance().
- Load your app in MSDEV Dependency Walker, and check out the DLLs.
How low can you go ? (MS rant)
|
|
|
|
|
|
Rather than using the debug version, why not just build the release version with full debug symbols?
I disagree with your assertion that debug==predictability.
|
|
|
|
|
note that MS prohibits you from distributing the debug versions of their DLLs.
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
Dear All,
i have created xml stream in VC++ now i want to transfer
this xml stream to the server on sockets. i am using
CSocket class. plz if some one of you can guide
me how can i do this. if any code example is available
plz reffer it.
lodhi
|
|
|
|
|
The usual way is to use SOAP. Never done it in VC with MFC though.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
And why transfering a XML over a socket should be different from tranfering a "Hello, World" ?
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Daniel Turini wrote:
And why transfering a XML over a socket should be different from tranfering a "Hello, World" ?
good point
|
|
|
|
|
Hi folks,
I hope this is an appropriate place to pose this question as I'm looking for a C++ (maybe COM if needed) solution.
The situation is that I have a system running with a mirror disk set under Win2k Server. The server does not have a keyboard, mouse or monitor. It is not usually accessed remotely except via a web server. A dynamically generated page from the web server can tell be of problems with the system if I know the problem is there to add information about the fault.
I want to be able to detect when a mirror disk set is not working.
From what I understand, if there is an error while the OS is running related to the fault tollerance system then an event will be added to the system event log. This I can access using OpenEventLog(), etc. No problems there.
If the system fails while the OS is not running (i.e. the ribbon or power cable drops out of a drive while the hardware is being moved) then no event log entry is raised to show this when the OS starts up. This is a problem.
I've done some tests with a keybaord/monitor connected to the system and see that when the mirror set fails when the power is off the OS (or at least the administrators Disk Management utility) knows that the mirror set has failed because it shows the status of the volume and the status of the partitions making up the mirror set as being "Failed Redundancy".
So bottom line. My question really is how can I determine that the status of a mirror set programatically? I want to know if the status is "OK", "Failed Redundancy", "Regenerating", etc.
Again, I'm sorry is this is the wrong board. I considered putting it on the OS/Admin one but thought it too programing related for that.
---
Lee
|
|
|
|
|
I've found that Win2k Service Pack 2 helps me alittle. It now raises an event at startup when the mirror set has failed while the machine is powered down.
I'd still like to know how to access the state of the mirror set via some means other than the event log entries as there are no entries to show the set has been recovered.
---
Lee
|
|
|
|
|
Why can't I use static member variables inside member functions even using the scope resolution operator...???
I have the following and it won't work and i'm confused as to why not:
class myClass{
void MyFunc(){ myClass::m_myStatic = NULL; }
UINT m_myStatic;
};
UINT myClass::m_myStatic = NULL;
The above does work...but I get an unresolved external error when I try the extact same thing inside a member function...
Why can't I use static members inside non-static member functions...? I thought this is what the scope operator was for...???
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
1.) Add the static word to your static member!
static UINT m_myStatic;
2.) You don't need to write myClass::m_myStatic in your member function, just write m_myStatic .
void MyFunc(){ m_myStatic = NULL; }
class myClass
{
void MyFunc(){ m_myStatic = NULL; }
static UINT m_myStatic;
};
UINT myClass::m_myStatic = NULL;
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Sorry that was a typo I had the static keyword there I just missed while typing...
Anyways, I still get the unresolved error:
class myClass{
public:
static WNDPROC m_wndProc;
protected:
void SubclassMyWindow();
};
void myClass::SubclassMyWindow()
{
m_wndProc = NULL;
}
Even if I use the scope operator...whats going on...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You don't have to clarify your variable with the scope operator because you're already inside your class scope:
class myClass
{
static UINT m_myStatic;
void MyFunc(void) { m_myStatic = NULL; }
};
You have to declare the member variable as static in your class definition before it's really static.
The implementation file is correct to initialze m_myStatic at runtime, but NULL is usually used for pointers, not integers, did you mean to use 0 (zero) instead?
-- ian
http://www.ian-space.com/
|
|
|
|
|
I think the problem is that you have to initialize your static variables like you have shown:
<br />
UINT myClass::m_myStatic = NULL;<br />
You can also assign them in member functions with no problems. You don't even need to scope it. But they have to be declared like the above, or else the compiler whines.
Does that make sense?
Even a broken clock is right twice a day.
|
|
|
|
|
Hi Navin thanks for the reply...
I got it working, thanx again!!!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
1.
Please tell me what’s wrong with my program?
// IDD_DIALOG1 is ID OF Dialog
GetDlgItem(IDD_DIALOG1)->SetWindowText(_T(“The Dialog Caption”);
…..
2.
How can I get the dialog windows pointer?
|
|
|
|
|
Charlady wrote:
GetDlgItem(IDD_DIALOG1)->SetWindowText(_T(“The Dialog Caption”);
Forgive me it this turns out to be wrong as I am just hashing my through dialogs as of late but
Charlady wrote:
GetDlgItem(IDD_DIALOG1)->SetWindowText(_T(“The Dialog Caption”);
return the HANDLE in question. If you wanted it as a pointer I should think you would have no prolem assigned the HANDLE to a pointer. I do hope this helps, as I said... I'm just getting around to learning the nitty gritties of dialogs myself.
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
Are you trying to do this within a method the dialog itself? If so, all you have to do is:
SetWindowText(_T("The Dialog Caption"));
If you're trying to do this from somewhere else in your UI, say, modifying a modeless dialog, you've probably got a pointer to the dialog instance, so just call the method on the pointer:
m_pMyDialog->SetWindowText(_T("New Caption"));
Or, if you own it as a class member and not a pointer, use the . (dot) member accessor instead of the pointer one ( -> ).
GetDlgItem() is used to get child item windows of the dialog.
-- ian
http://www.ian-space.com/
|
|
|
|
|
|
GetDlgItem() function uses to get the handle of the controls lying on a dialog. So in this way it can't be used.
You can get the dialog handle by the m_hWnd member variable of the dialog. In the following way
" this->m_hWwn"
C.R.Naik
|
|
|
|
|
Any suggestion for a better piece of code to move the focus to the next control in a dialog box? I am not using rich edits, and I tried some other things without the desired results. Somehow though, I suspect this is not the best way to go about it:
[Edit] I have this edit restricted to six characters but when I try to use the DDV max chars value to contol I get what appears an indexing problem as it moves the focus on the 7th char but that char isn't placed into the next edit which hampers continuity of the user's typing.
<br />
void CRHTC100Dlg::OnChangeId()
{<br />
CString str;<br />
GetDlgItemText(IDC_ID,str);<br />
if ( str.GetLength() == 6)<br />
NextDlgCtrl(); <br />
}
This just seems cumbersome to me and I'm just hoping to find some input that saves me from spending to much time researching as it does work this way.
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
What the heck am I doing wrong...?
The control isn't drawing properly when I use the following:
BOOL CEditorDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
CFont myFont;
myFont.CreateFont(14, 0, 0, 0, FW_NORMAL,
0, 0, 0, ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"Courier New");
CEdit* pControl = (CEdit*)GetDlgItem(IDC_EDIT1);
ASSERT(pControl);
pControl->SetFont(&myFont);
return TRUE;
}
Can you even change a CEdit's font....? Or are you suppose to even...? I need a fixed width font...
I know this is possible cuz notepad lets you do this...and they use the same friggen class...what am I doing wrong...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You have to make the CFont object myFont global.
Remove the declaration of myFont in the OnInitDialog function and add it to the dialog header file. The first lines in your dialog header file should read:
class CEditorDlg : public CDialog
{
public:
CEditorDlg(CWnd* pParent = NULL);
CFont myFont;
Try it, it works
-Dominik
|
|
|
|
|
Thanx for the reply...
I figured this out shortly after my post, however i'm not entirely certain why it has to be this way...
I'm assuming it has to do with each time WM_PAINT is called and it refers to some DC object like a font and crashes when the object is destroyed by being locally scoped...??
However this doesn't make sense either cuz I thought all objects were cached inside the DC as one big structure...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|