|
Last question,
Is it possible to use reflection in standard C++? I need to invoke a class from it's name. It's trivial in C# .NET like Activator.CreateInstance will do, but what about C++?
|
|
|
|
|
Christian Flutcher wrote: Is it possible to use reflection in standard C++?
With standard C++, NO. Reflection is something that is within the managed (.NET) world. I would also recommend that you start a new thread if you have a "totally new" question. That would kinda fetch replies from more people and give more visibility to your query.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Okay. I should stop bothering you now. I will look into the reflection stuff later. Thanks for the help and have a great day.
|
|
|
|
|
|
IPC[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
prviously i tried with sockets for bluetooth programming but i found microsoft supports only a few dongle so now i decided to go with serial communication, so any body have tutorials or any materials regarding this if plz.. post me...
|
|
|
|
|
hi...
I have a CString like CString str ="1,2,3,4,5,6";
now i want to retrieve each one as string like
str1=1;
str2=2;
str3=3;
here "," is delimeter.
Even this is so simple... but i am not familier with CString methods.
please help me in this regard
Thanks in advance....
Regards
varma.
|
|
|
|
|
Use AfxExtractSubString function!
Regards,
Rane
|
|
|
|
|
See CString::Tokenize
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
you can do like this.
CString out = "1,2,3,4,5,6";
out.Replace(_T(","), _T(""));
int len = out.GetLength();
for(int i=0;i<len;i++)>
{
String[i] = out.Mid(i,1);
AfxMessageBox(String[i]);
}
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Thanks....
But i have Two digit nubers also.....
like
CString out={"1,10,345"};
then how to do...
Thanks in advance
varma
|
|
|
|
|
|
The people who have used eMule knows that There are a few buttons on top of the background Dialog(The buttons actually is in a CToolBarCtrl).
Click each button, the background dialog shows an associated view(Actually CDialogs)
I read the code of eMule, and code as it, but I Can't pass.
I'm so down in spirits. Can I send the code to somebody and give me a hand?
|
|
|
|
|
fantasy1215 wrote: Can I send the code to somebody and give me a hand?
To do what? What is it you're trying to do.
|
|
|
|
|
In the background dialog, On top of the background dialog there is a CToolbarCtrl with many buttons. When click each button there to show associated dialog(all without title bar styles) embeded in the background dialog.
|
|
|
|
|
Take CArray for example, it has two member functions as below:
TYPE& GetAt(
INT_PTR nIndex
);
const TYPE& GetAt(
INT_PTR nIndex
) const;
When do a function call, does the return value type determines which one to call?
Is it a standard of C++?
system
modified on Wednesday, September 3, 2008 11:43 PM
|
|
|
|
|
That's an overloaded function, not an override.
C++ doesn't allow overloads that only differ by return
type, but it does allow overloads that differ by const.
Which one gets used depends on the context of the call.
For example, if you have a const reference/pointer to an
array and you call GetAt(), it will use the const function
overload, which wil return a const reference. Since the returned
reference is constant, you can't modify the object or call any methods
that modify the object, which preserves the const state of the array
referenced or pointed to by the original const array reference/pointer.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I have the following Code Fragment:-
SHFILEOPSTRUCT fs;<br />
::memset(&fs, 0, sizeof(SHFILEOPSTRUCT));<br />
<br />
CString From=m_sDBDir+"Global\\gf000.gni";<br />
<br />
FILE* F=fopen(From,"rb");<br />
char Buf[1024];<br />
VERIFY(fread(Buf,1,512,F));<br />
fclose(F);<br />
ASSERT(F);<br />
<br />
fs.pFrom =(LPCSTR) From;<br />
fs.pTo = "C:\\gf000.gni";
fs.wFunc = FO_COPY;<br />
<br />
<br />
UINT Result= ::SHFileOperation(&fs);
The Section <file*> is included that the Source File exists and is readible. This works perfectly and shows that all is well in the garden.
However I get ErrCode 402 :'Cannot Copy File: Cannot read from the source file or disk', even with more trivial file specs.
Anyone any idea what's wrong ?
Thanks,
Bram van Kampen
|
|
|
|
|
|
Hi,
That's excelent!! Tried it, got it in one. I had left HWND NULL (because I'm not using ANY of the User Interfaces in my App.) Anyways most Wnd Api's requiring HWND default to the topwindow if you use NULL. Not Thisone, it choked on it! The Error Message our Bill gave was of no help at all. In future I'll use this handy class.
Thanks
Bram van Kampen
|
|
|
|
|
In the OnOk() of the dialog class
I have removed
CDialog::OnOK();
so that the dialog remains
I wish to clear the contents of the edit box after the ok button is selected
but the dialog remains with the previous text entered.
How do I clear this, and also on the off chance, how do I
initialize this box with another message, at any time.
has anybody and idea?
Thanks Simon
|
|
|
|
|
Did you call 'UpdateData(FALSE) after you cleared the CString that holds the Edit Control's value?
Regards
Bram van Kampen
|
|
|
|
|
That seemed to have done the trick thanks
|
|
|
|
|
is there an x64 version of HTMLHELP.LIB ?
i'm trying to migrate a project to x64 and i'm getting an unresolved external on HtemlHelpA.
::HtmlHelpA(NULL, path, HH_DISPLAY_TOPIC, 0);
the function is defined in htmlhelp.h, but it doesn't seem to be in the .LIB .
|
|
|
|