|
The SetTimer() call is correct. If I change the dialog to a modal dialog by calling DoModal(), the timer fires correctly. I think it might have something to do with the way I'm setting up my modeless dialog. I follow the MSDN directions (which are rather vague and somewhat scattered), and I follow the tutorial article in Code Project as to how to set up modeless dialogs. I'm not using the CreateDialog() function. Rather, I call Create() to make the window appear and I use DetroyWindow() to close the dialog--I also override the PostNcDestroy() function to clean up my this pointer. Any thoughts?
|
|
|
|
|
From what method of the dialog class are you calling SetTimer()?
Can you post the code fot that call?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I need help with accessing a table in a mutlitable recordset. I have :
3 tables as follows
CString COrderSet::GetDefaultSQL()
{
return _T("[tbladdress],[tblcontact],[tbltest]");
}
and I am trying to add new record to each table individually.
My "m_pSet" that is a joint recordset of these three. How can I get a handle or pointer to each table.
When I do : m_pSet->AddNew() I get a "recordset read-only" error msg. which make sense because it doesn't know where to add a new record. (note that m_pSet is a joint set.)
Please help.
paulo.
|
|
|
|
|
paulosuckow wrote: and I am trying to add new record to each table individually.
But you're not. Your recordset is dealing with three tables, not one. Make a recordset for each table, and add to each accordingly.
"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
|
|
|
|
|
hi all
i have a bunch of classes mostly extended base classes like Form, TabControl...
all of them needs to know abouth each other
in the moment i have
_TabCon = gcnew TabCon( this );
Controls->Add( _TabCon );<br />
...<br />
..<br />
<br />
TabCon::TabCon( MainForm^ F)<br />
{<br />
Form = F;<br />
..<br />
.
so all classes know MainForm and MainForm know all classes
is there a better way ? whit out the need of Form = F; in each class
something like
static global MainFromLink = MainForm;
so that i can reach this from anywhere
MainFrom is
ref class MainForm: public System::Windows::Forms::Form
|
|
|
|
|
Usually the reason for one control's class "needing" to know about another control is because of the data stored in the class, and has nothing to do with the control itself. If this is your situation, then consider collecting the key data together in one "data" class, and accessing that class via the CWinApp object (or a global variable).
|
|
|
|
|
Hmmmm
looks like in the moment :
namespace WhatsUp<br />
{<br />
MainForm::MainForm( )<br />
{<br />
Size = System::Drawing::Size( 600, 600 );<br />
MinimumSize = System::Drawing::Size( 600, 600 );<br />
<br />
_TabCon = gcnew TabCon( this );<br />
Controls->Add( _TabCon );<br />
<br />
_TabCon->_PageStatus = gcnew PageStatus( );<br />
_TabCon->Controls->Add ( _TabCon->_PageStatus ); <br />
<br />
_TabCon->_PageSetup = gcnew PageSetup( );<br />
_TabCon->Controls->Add ( _TabCon->_PageSetup ); <br />
<br />
_PlugLoad = gcnew PlugLoad( this );<br />
_IniLoad = gcnew IniLoad ( this );<br />
}<br />
}<br />
[System::STAThreadAttribute]<br />
int main(array<System::String^ >^ args)<br />
{ <br />
System::Windows::Forms::Application::EnableVisualStyles();<br />
System::Windows::Forms::Application::SetCompatibleTextRenderingDefault(false); <br />
System::Windows::Forms::Application::Run( gcnew WhatsUp::MainForm() );<br />
}<br />
...<br />
..<br />
namespace WhatsUp<br />
{<br />
IniLoad::IniLoad( MainForm^ F )<br />
{<br />
Form = F;<br />
Form->_TabCon->_PageStatus->StatusText->Text += "Proccessing ini File" + System::Environment::NewLine;<br />
PageSetup and PageStatus are derived TabPages
i have a few textboxes on them as output this are populated by
PlugLoad, IniLoad and many others
IniLoad loads an xml cheks it and give singel nodes to PlugLoad for future proccessing and so on
so all classes by it a derived like PageSetup or a base class like IniLoad needs to comunikate whit each other either to write something on screen or to hand over data for future proccessing
fcheng wrote: then consider collecting the key data together in one "data" class
i think this is basicli what MainForm do
it has a referenc / pointer to all used classes
i was basicly hopoing to by abel to prevent
IniLoad::IniLoad( MainForm^ F )
Form = F;
and use instead some global referenc to it but i can´t make managed things global
is there some EASY way to know who has called this class
IniLoad::IniLoad( )
Form = System::SomeFunction->The->oneWho->CalledMe;
whit out to use assembler
|
|
|
|
|
It was better you asked (Managed) C++/CLI forum.
|
|
|
|
|
Thank you! I have forced classes (friends) to know about each other (one time), but I considered it to be bad programming. Either it is global or it is not.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
hup some how i didnt saw the 2 abowe replays
this managed unmanaged clr cli mfc ... is so confusing to me in the moment
no idea in what i am programing
just that i am using visual c++
|
|
|
|
|
Hi,
When I try to build the workspace of my MFC DLL application it shows a link error as follows.
"LINK : error : Internal error during EmitMap
ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 0043FA39
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 000000F1
CONTEXT:
Eax = 007C80ED Esp = 0012F7C0
Ebx = 000000ED Ebp = 0012F8DC
Ecx = 0056D670 Esi = 007C80ED
Edx = 000000ED Edi = 007C80ED
Eip = 0043FA39 EFlags = 00010206
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 0000003B SegGs = 00000000
Dr0 = 0012F7C0 Dr3 = 000000ED
Dr1 = 0012F8DC Dr6 = 0056D670
Dr2 = 00000000 Dr7 = 00000000
Error executing link.exe.
Tool execution canceled by user."
When I build once again, it will be OK.
Anyone know what is happening?
Thanx in advance.
|
|
|
|
|
Actually no! I have a guess though – incremental compilation will sometimes result in a similar error because it did not know to recompile a particular piece of code, for some reason. Normally you can fix it by recompiling all, which may take a while. The thing that bothers me is the exception code; that is a code you never want to see and is what you normally see on a blue screen.
In either case I does not really matter unless you are the one creating the compiler, just recompile all.
I understand the reason you want to know, but you will run across many questions like that. If you dwell on them, they will drive you nuts, so just learn to accept them. If you are like me that may not be acceptable, but given time you will learn.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hello i have a function OnStart(){}
and inside this function there is a CArray<cstring ,="" cstring=""> FArray
that contains Filepathnames.
i want to create a function that take as a parametr CArray (so i can execute it inside OnStart() )
I try to create but when i put FindDF(CArray<cstring ,="" cstring=""> nArray) it says me i cant put < >
|
|
|
|
|
You need to have something like this:
FindDF(const CArray& filepathnames)
Kevin
|
|
|
|
|
i put
Find ( CString file , const CArray& FArray)
c:\program files\microsoft visual studio\myprojects\anaktisi\anaktisidlg.h(18) : error C2143: syntax error : missing ',' before '&'
c:\program files\microsoft visual studio\myprojects\anaktisi\anaktisidlg.h(18) : error C2059: syntax error : '&'
C:\Program Files\Microsoft Visual Studio\MyProjects\Anaktisi\AnaktisiDlg.cpp(850) : error C2955: 'CArray' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(238) : see declaration of 'CArray'
C:\Program Files\Microsoft Visual Studio\MyProjects\Anaktisi\AnaktisiDlg.cpp(851) : error C2511: 'Find' : overloaded member function 'double (class CString,const class CArray &)' not found in 'CAnaktisiDlg'
c:\program files\microsoft visual studio\myprojects\anaktisi\anaktisidlg.h(14) : see declaration of 'CAnaktisiDlg'
|
|
|
|
|
Immunity18 wrote: c:\program files\microsoft visual studio\myprojects\anaktisi\anaktisidlg.h(18) : error C2143: syntax error : missing ',' before '&'
Did you forget #include <afxtempl.h> in your project's stdafx.h file?
"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
|
|
|
|
|
#include "stdafx.h"
its the first of my include
|
|
|
|
|
Immunity18 wrote: #include "stdafx.h"
its the first of my include
Meaning what?
"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
|
|
|
|
|
i because it was <afx> it wasn't visible and i thought u said
did you forget to #include , in your project, the "stdafx.h" file ?
And yes i didnt #include "afxtempl.h"
but not that i forget ,because i didnt know i had :P
|
|
|
|
|
Now i include it my
double CAnaktisiDlg::FindDF(CString file , CArray < CString, CString > FArray)
works fine
thank you onces again David
(both kevin and mark )
|
|
|
|
|
Here's an example of how to pass an array argument from the CArray implementation in afxtempl.h
INT_PTR CArray<TYPE, ARG_TYPE>::Append(const CArray& src)
{
ASSERT_VALID(this);
ASSERT(this != &src);
if(this == &src)
AfxThrowInvalidArgException();
INT_PTR nOldSize = m_nSize;
SetSize(m_nSize + src.m_nSize);
CopyElements<TYPE>(m_pData + nOldSize, src.m_pData, src.m_nSize);
return nOldSize;
}
Kevin
|
|
|
|
|
Since CArray is a template class, you need to declare your array type as such.
You can either use something like this
CArray<CArrayMembersClass, CArrayMembersClass&>
or to shorten things up, use typedef to create an alias for the template class:
typedef CArray<CArrayMembersClass, CArrayMembersClass&> CArrayMembersClassArray;
and use "CArrayMembersClassArray" as a variable type.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i tried
FindDF(CString file , CArray < CString, CString& > FArray)
and when i press OK nothing happends (pressed it many times)
|
|
|
|
|
I'm sorry...what?
What do you mean you "press ok"? Runtime? Design time?
I'm lost
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hehehe sorry i let you alone inside forest
Ok here i am to rescue u !
i use Microsoft Visual studio C++ 6.0 enviroment
i press right click on the Class and press Add member function
on the window it pop up i time
Type: double
Function declaration : Find(CString file , ....) and i have to press OK or cancel
|
|
|
|