|
Are you talking about a communication port used by sockets?
If so, then bind() should fail if the port is in use. Note that even if a port is in use by
another protocol, it's still possible to use the port. For example you can have tcp listen on
a port and use the same port number for UDP.
|
|
|
|
|
Hello
I build my project and everything builds fine untill when I press F5 to debug my application. As soon as I press F5, a dialogbox comes up asking me to "enter the path for MFCS42.PDB file". I have looked into the "C:\Program Files\Microsoft Visual Studio\VC98\MFC\Lib" folder and found this PDB file. But, when I change the path to this folder, it says though a file has been found, this is not the correct file. What could be the problem ??
I press cancel button, and the debugging continues normally without any problem. Though the debugging is continuing without any issues, I want to know the reason for this issue. Can someone please help me ??
|
|
|
|
|
When closing the childframe window which is having some views,
Is RedrawWindow() must be called or no need.
Thanks & Regards,
Suman
|
|
|
|
|
rp_suman wrote: RedrawWindow()
For which window you are talking about ?
Its not needed.
|
|
|
|
|
After closing the childframe, the whole window should be updated so that the childframe should not be visible and other windows (if there are some other childframe)should come to visible. For this does we need to call RedrawWindow() of MainFrame?
Thanks & Regards,
Suman
|
|
|
|
|
rp_suman wrote: For this does we need to call RedrawWindow() of MainFrame?
No.
|
|
|
|
|
Thanks. But how the window is updated?
Is any method like Update() or Paint() called automatically?
Thanks & Regards,
Suman
|
|
|
|
|
As child window is destroyed, that causes invalidation of that area.
|
|
|
|
|
Dear All:
I have code in VB program:
<br />
Do While trs.EOF = False<br />
rs1.AddNew<br />
For i = 0 To trs.Fields.Count - 1<br />
rs1(i) = trs(i)<br />
Next<br />
rs1.Update<br />
trs.MoveNext<br />
Loop<br />
How write it in VC??
Help me plz...
Thanks
|
|
|
|
|
Why ? Where are you stuck ? What is rs1 and trs ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
rs1 and trs in VB is:
Set trs = New ADODB.Recordset // for ms access
Set rs1 = New ADODB.Recordset // for sql server
My Stuck is:
I want to read a table (Ms Access) and insert into another table (sql Server) with the same value.
And here is code in VB:
Set rs1 = New ADODB.Recordset<br />
<br />
rs1.Open "select * from " & s1, con1, adOpenDynamic, adLockOptimistic<br />
<br />
' Populating the created table with the values<br />
<br />
If trs.EOF = False Then<br />
<br />
trs.MoveFirst<br />
<br />
Do While trs.EOF = False<br />
rs1.AddNew<br />
For i = 0 To trs.Fields.Count - 1<br />
rs1(i) = trs(i)<br />
Next<br />
rs1.Update<br />
trs.MoveNext<br />
Loop<br />
<br />
MsgBox "Data entered successfully", vbInformation<br />
End If<br />
My problem is rs1(i) = trs(i)
I write it in VC++ is m_pRecordsetMsAccess[i]=m_pRecordsetMsSQL[i] but wrong, Help me Plz
|
|
|
|
|
In VC++, There would be CRecordSet derived class, having member variables mapped to fields in table.
For example,
class CDBSet : public CRecordset
{
CString m_name;
long m_id;
};
void CDBSet::DoFieldExchange(CFieldExchange* pFX)
{
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, _T("[Field_name]"), m_name);
RFX_Long(pFX, _T("[Field_id]"), m_id);
}
cuongnq wrote: I write it in VC++ is m_pRecordsetMsAccess[i]=m_pRecordsetMsSQL[i] but wrong,
There is no operator [] , so it is not possible, you can do like this,
rs1.AddNew( );
rs1.m_name = m_pRecordsetMsSQL.GetFieldValue(..);
rs1.m_id = m_pRecordsetMsSQL.GetFieldValue(..);
rs1.Update( );
|
|
|
|
|
<br />
rs1.AddNew( );<br />
rs1.m_name = m_pRecordsetMsSQL.GetFieldValue(..);
rs1.m_id = m_pRecordsetMsSQL.GetFieldValue(..);
rs1.Update( );<br />
In here, some fields can not know before. So i can use your method,I want to get Recordset Object as like as RS(i). Like that:
<br />
theApp.m_pRecordsetSQL->AddNew(); <br />
for (int i=0 ; i<theApp.m_pRecordsetMsAccess->Fields->Count; i++)<br />
{<br />
:confused:<big><code>Help me here plz
} theApp.m_pRecordsetSQL->Update();
theApp.pRecordsetMsAccess->MoveNext();
|
|
|
|
|
cuongnq wrote: So i can use your method,I want to get Recordset Object as like as RS(i). Like that:
I doubt, if it is possible in VC++.
|
|
|
|
|
Thanks, you right
What can i do? But i can not use your method when some fields can not know before...
<br />
For i = 0 To trs.Fields.Count - 1<br />
rs1(i) = trs(i)
Next<br />
Thanks for support.
|
|
|
|
|
See if things mentioned in my reply are useful for you.
|
|
|
|
|
The MFC CRecordSet class uses ODBC.
|
|
|
|
|
|
Hi.
I am feeling a bit overwhelmed at the moment, I could use a small amount of direction...
How do I go about installing a crash handler into my own application? One that would catch crashes and generate a minidump?
I've already got one that works in .net 2003 -- but will need to move on to the next devstudio sooner or later....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Don't. Dr.Watson already does this. To configure enter "drwtsn32" in the run dialog.
Steve
|
|
|
|
|
DrWatson is really only appropriate in an environment I am in control of.
I work on a commercial application.... which does crash from time to time.
I wanna capture these crashes on user's machines out there in the real world...
DrWatson is not appropriate for this situation.
So, back to my original question...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
|
Thanks for that. Our old crash handling code was kinda complex, but could be boiled down to just this...
With the conversion from 2003 to 2005 there's lots of things to figure out, lots of things that were defined and are now not defined....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
How does the .Net 2003 one work?
You could add exception handling to catch crashes. Not sure what information you might want in a "mini-dump"
One place I worked at had a trace mode that users could turn on to log application execution. The trace would generate text for key function call points and variables. There was also an exception handler that would save the trace log out before closing.
|
|
|
|
|
A minidump is somethat can be generated by a windows api -- it's a binary file that contains the status of the program at the time of the crash. It contains registers, stack frames, list of modules loaded, etc...
You can load the dump directly into visual studio, to see the conditions of the crash.
It's very handy.
We like to do this automatically -- if their program crashes, it generates this file and get's uploaded back to our servers. It's a handy way to see what problems our users are running into without having to interact with them...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|