|
|
well, first, try to reduce the amount of code that you post.
second, yes you can do this!
you read the XML file with the XML DOM API from microsoft ( msxml ).
and for each type you collect the information in the XML file, and call a constructor of your objects with the appropriate values.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hey!!! You are allowed to post code here not the entire project. I think while posting it you should have got atleast three warnings! If the text content is too long normally we get *a* warning.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
entire project? I dont think so... the project is huge and is mostly graphics in OpenGL and frames... so this is only a fraction with classes
any examples of the msxml anywhere? is it easy? do you have any sample code?
|
|
|
|
|
we're not on CP to do the job for you....
go and search yourself, and if yoou have any particuliar question, ,then only you are allowed to ask, with a short code sample to explain your problem (but not the whole huge file like you do )
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
ok, next time i'll cut the code short
but please give me some short sample code to show how to do it
like how to save form
class A() to <A =" "> etc..
-- modified at 9:45 Tuesday 30th May, 2006
|
|
|
|
|
Hello I am Javi,
I am doing a validator certificate and i need to use the CMapi of MFC that uses the file mapi.h and in the compilation i have a lot of error, very stupid like missing { before *, when the * is from a pointer.
What can I do? Can anybody help me? I am sure that the source code is correct is only a library problem, anybody knows with library i must to add?
Thank you very much!!!
-- modified at 15:20 Monday 29th May, 2006
|
|
|
|
|
Hi !!!
Can me somebody tell what is an singletone design pattern?
Please give me some little code samle.
Thanks.
-:KNOX:-
|
|
|
|
|
|
search with this key word in code project you will get many.
One example from CP: Singleton Pattern & its implementation with C++
--------------------------------------------------------------------
class my_singleton
{
private:
std::string my_string;
my_singleton() : my_string("foo bar bash") {}
public:
static my_singleton &instance()
{
static my_singleton global_instance;
return global_instance;
}
std::string get_string() { return my_string; }
};
...
cout << my_singleton::get_instance().get_string() << endl;
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Hi,
this class isn't really a singleton, because you can make more than one instances of it.
You need to change the modifier of the constructor from public to at least protected.
This way one is forced to use the instance function.
class my_singleton
{
private:
std::string my_string;
my_singleton() : my_string("foo bar bash") {}
public:
static my_singleton &instance()
{
static my_singleton global_instance;
return global_instance;
}
std::string get_string() { return my_string; }
};
...
cout << my_singleton::instance().get_string() << endl;
codito ergo sum
|
|
|
|
|
Oh. Sorry & Thanks for correcting me.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Thanks for the help.
-:KNOX:-
|
|
|
|
|
You are always welcome
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Hello!
I have a simple application done with VC++ (2003 .NET). I made simple dialog based application with some buttons (with resource editor). Now I want to do something with images and want to try cool code with CImage class. By MSDN documentation I have to to include
<br />
#include "afxstr.h" (I replaced <> with " so it can be seen in this post)<br />
#include "atlimage.h"<br />
in that exact order. Project setting is "Use MFC in shared DLL". When I do this I get many linker errors like
<br />
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(isctype.obj) : error LNK2005: __isctype already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMTD.lib(strftime.obj) : error LNK2005: _strftime already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCR71D.dll)<br />
LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in msvcrtd.lib(MSVCR71D.dll)<br />
zlib.lib(minigzip.obj) : error LNK2005: _error already defined in webServer.lib(uemf.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __stricmp already defined in LIBCMTD.lib(stricmp.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __strnicmp already defined in LIBCMTD.lib(strnicmp.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: _strcspn already defined in LIBCMTD.lib(strcspn.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __setmbcp already defined in LIBCMTD.lib(mbctype.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___crtExitProcess already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __cinit already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
libc.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
libc.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
libc.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll)<br />
libc.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __exitflag already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __wpgmptr already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __pgmptr already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___winitenv already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __wenviron already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___initenv already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __environ already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___wargv already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___argv already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: ___argc already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __winminor already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __winmajor already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __winver already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __osver already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in LIBCMTD.lib(crt0dat.obj)<br />
libc.lib(crt0dat.obj) : error LNK2005: __umaskval already defined in LIBCMTD.lib(crt0dat.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __itoa already defined in LIBCMTD.lib(xtoa.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __lseek already defined in LIBCMTD.lib(lseek.obj)<br />
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __unlink already defined in LIBCMTD.lib(unlink.obj)<br />
what can I do. Can I include CImage some other way? Please help!
Best regards,
Rostfrei
|
|
|
|
|
all static libraries must use the same runtime libraries as your application. if you are using MFC in a DLL in your EXE, the .LIBs must all be built with the "multi-threaded DLL" setting; if you are using statically-linked MFC in your EXE, the .LIBs must all be built with the "multi-threaded" CRT.
see the Code Generation option in the library's C/C++ Properties.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I made sure that all files are compiled with "Use MFC in a Shared DLL" option and they all have "Multi-threaded Debug DLL (/MDd)" runtime library selected and I still have linker errors. If I comment includes
<br />
#include <afxstr.h><br />
#include <atlimage.h><br />
there is no link errors anymore.
Any idea?
Regards,
Rostfrei
|
|
|
|
|
May be Try with giving complete path..
ex: "..\afxstr.h"
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
I have developed a COM component using visual studio 7. There is an exposed class that exports some functions and get/sets respectively. I developed this component in two phases. The first phase was designed as a render component. It worked with VB-6, VB.NET CSharp. I appended a Print facility to this component and it works fine under VB.NET and CSharp, however when I run a test harness under VB6 I get problems. It seems VB6 cannot access the Print facilities that I added to this module.
Can anyone tell me what would be causing this to work in VB.NET and C Sharp but not in VB6?
Thank you for your time.
Dave
|
|
|
|
|
It would be nice if you can provide more info.
What is the error you are getting?
what line of code is failing? etc....
rgds...Milon KB.
|
|
|
|
|
I am sorry for not supplying enough information.
I did however manage to find an article that described the problem. It has to do with VB6 and reserved names. My COM Object exported a method named Print. This is a reserved word in VB6 and therefore did not evaluate at runtime.
Quoting from the Net
"There exists a bug in VB6 (and earlier, I assume) that
when you reference a library in the Project Properties and
you attempt to call a method within this object that has
the same name as a reserved word, you get the
error "Object does not support this property or method."
|
|
|
|
|
Hi,
I have been doing an application that contains flex grid control in which there are details about student marks in various subjects.I want to access the data from the flexgrid control regarding a student in the second dialog window which contains the editboxes of different subjects.Now my doubt is how can i move forward to access the student marks from the control to the next dialog window by giving the particular student name in the first dialog window.
|
|
|
|
|
My SpinButtonCtrl runs correctly, but I can not exceed the number of 16960 when clicking the up-arrow.
I use an Editbox and a vertical Spinbutton.
Need a new idea.
Thanks
|
|
|
|
|
|
Hi Chris,
thanks for answer.
Pleas see Code:
BOOL CSPINDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// IDC_SPIN
CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN);
pSpin->SetRange(0, 1000000); // what I want
iStart = 16900; // to if more than 16960 is possible
pSpin->SetPos((int) (iStart));
UpdateData(FALSE);
double dPos = pSpin->GetPos();
// Editbox
CWnd* pEdit = GetDlgItem(IDC_BUDDY_SPIN);
CString strValue;
strValue.Format("%u", iStart );
pEdit->SetWindowText(strValue);
...
}
void CSPINDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
if (nSBCode == SB_ENDSCROLL)
{
return; // falsche Nachrichten zurückweisen
}
if (pScrollBar->GetDlgCtrlID() == IDC_SPIN)
{
CString strValue;
strValue.Format("%u", (int) nPos );
((CSpinButtonCtrl*) pScrollBar)->GetBuddy()->SetWindowText(strValue);
}
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
|
|
|
|