|
The assertion comes because you try to set the text before the dialog is created with DoModal(), so the dialog has no handle, and the API function fails.
To do it properly, go in the CDlgCal::OnInitDialog() (Override the WM_INITDIALOG message if you do not have that function present in the class browser), and put your code in this function. i.e. :
... CDialog::OnInitDialog(...bla...)
{
...
SetWindowText("Step to something");
...
}
~RaGE();
|
|
|
|
|
Thanks guys - for the replies - there are some nice expainations there. I've moved my 'SetWindowText' call and its all working fine now.
Thanks again, Ali.
Ali
|
|
|
|
|
hi,
i've developed a program that puts a struct into a linked list... Wenn i put the new record into my list, and i read it after that, the program crashes(wenn getting the CString)...
the problem is that my list is not updated at all... if i read a number that is inserted with the value 3, it has the value -2421523832 wenn retreiving it...
now i want to know how to update my list, not that i don't know it at all but my way is not working.
i get the pointer(Leverancier) to my struct in the function that updates the list...
<br />
NewLeverancier = new CLeverancierStruct;<br />
NewLeverancier = Leverancier;<br />
m_LeveranciersLijst.AddTail(NewLeverancier);<br />
should this work?
[]D [] []D []
|
|
|
|
|
Hi Willen,
I asked this very question a couple of days ago. Didn't you undesrstand my reply? If so, I'll gladly try to make myself clearer, if you're so kind as to tell me what you didn't get.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
well it didn't work...
i made the the struct then i send the pointer to that struct towards the function to safe it in the list... than after that i just want to put it into the linked list...
so: you say i have to do this:
<br />
<small>NewLeverancier = new CLeverancierStruct(*Leverancier );<br />
m_LeveranciersLijst.AddTail(NewLeverancier);</small>
[]D [] []D []
|
|
|
|
|
okey, i tried it one more time, and it does copy the values of the struct but the problem with the CString still remains....
[]D [] []D []
|
|
|
|
|
oke...
I'm getting pretty crazy here... it was all a compiler fault... i rebuilt my hole project and guess what: problem solved.... damn those debug files....
thanx for helping me out...
[]D [] []D []
|
|
|
|
|
You need to give us some more information. From the code above it looks like you
have a pointer which you set to a new struct instance. You then point it to
a previous instance which you add to the list...? It may already be in!
You mention strings and numbers without giving us actual facts / definitions.
Try something like the following (if you like MFC):
struct Foo
{
int nBar;
};
CTypedPtrList<CPtrList, Foo *> FooList;
Foo *f1 = new Foo;
Foo *f2 = new Foo;
f1->nBar = 3;
f1->nBar = 17;
FooList.AddTail (f1);
FooList.AddTail (f2);
Foo *f = FooList.GetHead ();
TRACE1("nBar=%i\n", f->nBar);
f = FooList.GetHead ();
TRACE1("nBar=%i\n", f->nBar);
...
There are STL equivalents to the above code, but I'm not so confident with STL to rattle
out a chunk of code off the top of my head.
Iain.
|
|
|
|
|
Hi,
I have programmed a MFC application under Win XP, and now i try to run my app on Win98.
I have copied the following files to the win98 system dir:
MFC42.dll, msvcp60.dll, msvcrt.dll
I get the following error:
The MSVCRT.DLL file is linked to missing export NTDLL.DLL RtlGetNtVersionNumbers
With Dependency Walker i see that the version of ntdll.dll not correct is for my app. When i copy a newer version of ntdll.dll to the system dir, windows doesnt start correctly.
Have i copied the wrong MSVCRT.DLL? Which DLL's do you normally use?
Thanks for helping me!
Willem
|
|
|
|
|
you can link your program statically with MFC
|
|
|
|
|
giant_hao wrote:
you can link your program statically with MFC
I have tried it, but then i get the error "Failed to create empty document", I get this error on the XP machine where i compiled the application. If i link the app normally, then the app runs fine!(under XP)
|
|
|
|
|
I can only get the menu of main frame by the operation of "AfxGetMainWnd()->GetMenu()",if I want to get the menu which is owned by specific document template,how can I do?
|
|
|
|
|
If you have access to the CDocTemplate objects that were registered in InitInstance you can get it like this:
pTemplate->m_hMenuShared
You can get a specific doc template by iterating the CDocManager object:
CDocManger = *pDocMan = AfxGetApp()->m_pDocManager;
POSITION pos = pDocMan->GetFirstDocTemplatePosition();
while (pos)
{
CDocTemplate *pTemplate = pDocMan->GetNextDocTemplate(pos);
// make use of the pTemplate here.
}
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I design a webservice with c#,
this webservice have some [WebMethod(EnableSession=true)]'s method
but when I use it with c++,Session lose
why?
thanks, codeproject
|
|
|
|
|
How can I pass arguments to CDialog allowing me to update a CListCtrl?
ie OnDblClick/etc, I call a modal CDialog for editing purposes, however I cannot pass arguments (ie ListItem contents to change).
Basic question - guess I am basically lost
|
|
|
|
|
You could pass the address of the list control to the dialog just before you call the dialog's DoModal() . For example:
void OnDblClick()
{
CMyDialog dlg (this);
dlg.m_pListCtrl = &listCtrl;
dlg.DoModal();
}
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
How do I convert this type.
I'm importing the CDOSYS lib, and I need to call the
pFld->put_Value(_variant_t(myconvertedtype));
the Microsoft examples use static "myaddress@something.com" , and I've not done stuff with this before.
Thanks for your help.
|
|
|
|
|
CComVariant varMe("this is long ascii"String");
pFld->put_Value(varMe);
|
|
|
|
|
Sorry the proper answer is:
_variant_t vtTemp;
char* szTemp;
...
...
szTemp= (char*)malloc(100);
strcpy(szTemp,"hello there");
vtTemp.SetString(szTemp);
pFld->put_Value(vtTemp);
free(szTemp);
|
|
|
|
|
Hi,
The following compiles fine under gcc, but generates a compile error on line 2 in VC 7.0.9466 (error C2988: unrecognizable template declaration/definition)
template<class t,class="" alloc="">
template<class t1=""> // <------ error
CDSVectorBase<t,alloc>&
CDSVectorBase<t,alloc>::operator*=(const T1 &x)
{
...
Is this a problem with the C++ compiler, or is the code not ANSI compliant?
Thanks.
|
|
|
|
|
Can you please modify your post (or repost) using < and > for the angle brackets, otherwise codeproject thinks they are HTML tags and so does not display them.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Your program is correct, it is VC++ that is failing here. You can workaround the problem by defining your function in place, if you can afford it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
would anyone be able to point me towards a sample to make a activex ocx/dll that can be used in vb?
shotgun
|
|
|
|
|
I made an IE toolbar but there is just one problem. It works perfectly on my system (Win98) when I compile it. The problem is when someone else tries to install. So far its only been tried on WinXP, not sure if that is the reason. What happens is that they can see the large Toolbar button at the top of IE but not the toolbar. Nothing happens when they click the large toolbar button and the toolbar does not show up under the toolbar menu. Why is this happening??
There is one thing that I changed that my be causing this, the top section of my Toolbar.rgs. I changed both the CLSID's and ForceRemove, could this be the problem? Right now it looks like this:
<br />
HKCR<br />
{<br />
KControl.ControlBar.1 = s 'K-Control'<br />
{<br />
CLSID = s '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}'<br />
}<br />
KControl.ControlBar = s 'K-Control'<br />
{<br />
CLSID = s '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}'<br />
CurVer = s 'KControl.ControlBar.1'<br />
}<br />
NoRemove CLSID<br />
{<br />
ForceRemove {E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16} = s 'K-Control'<br />
{<br />
ProgID = s 'KControl.ControlBar.1'<br />
VersionIndependentProgID = s 'KControl.ControlBar'<br />
ForceRemove 'Programmable'<br />
InprocServer32 = s '%MODULE%'<br />
{<br />
val ThreadingModel = s 'Apartment'<br />
}<br />
'TypeLib' = s '{BA246564-5224-4427-9595-CC18617AF491}'<br />
}<br />
}<br />
}<br />
If that is the problem than how can I fix it?? Please help, Thanks.
|
|
|
|
|
hi,
check for the old CLSID i guess you have not changed it everywhere..and other things which you ahve changed..also add the forceremove thing....and check hope it works fine for you..
cheers
Himanshu
|
|
|
|