|
Hamed Mosavi wrote: So, it seems that I should forget getting such information!,hoping "C/C++" designers think about this issue on later standards!! (If they think about it's usage, it's great usage to create independent classes or functions)
just don't try to solve you problem of design with another problem of design... if cant do the job with C/C++, it is simply because you haven't oriented you program for that language...
sorry, it's not an issue to consider in further standards, C/C++ are simply not java/C#...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Hi,
I've not been working with java or C#.
I just wanted to ask you, Do these languages solve these type of problems?
Furthermore, why giving information about a data type at compile time is not suitable for C/C++ ? I expect an object oriented programming language to give me the ability to write independent classes, is it too much?
(I accept the fact that it is not good for C/C++ to give me these infomation at runtime, you are absolutely right .)
Thank you for your great kindness . You pay the most attention. Excuse me if my english is bad .
//This is not a signature
while (I'm_alive) {
printf("I Love Programming");
}
|
|
|
|
|
Hi,
to answer your question, both languages have a mechanism to do wath you wanted.
In C# its called reflection. You can ask a type(class) which members it has at runtime.
Hamed Mosavi wrote: Furthermore, why giving information about a data type at compile time is not suitable for C/C++ ?
C++ doesn't have this for a few good reassons.
a. Its slow
b. It use more memory
c. hence there is no simple memory to a plain 'c' structure translation
Altough c++ doensn't have this. You can create it if you really need/want to.
But there is another approach you might consider. I guess you want to save data from
the memory to a file or vice versa. This is called persistence, or like MFC calls it
Serialisation. This method allows just the thing you want.
You can use there framework (CFile, CArcive) to implement the serialisation you need.
Or you can create your own using this concept. It differs from you concept to a more
OO solutiuon.
Your solution needed one class who knows everything about all classes (this is alsoo
nessecary in c#). When adding a new class you never know if there are restriction on
what to save to file (for instance, void pointer list, function pointers, temporary members)
In the more OO solution, everey class knows how to save/load itself too an archive or
other class object that handles binary data to be saved or loaded to file and memory.
In the second solution, when adding a new class you only need to implement the
save/load function for that class and everything works without problems.
codito ergo sum
|
|
|
|
|
Thank you very much.
Finally one programmer, just get what I needed. Thank you very much.
It's really kind of you. (If you want the fact, I always use CStdioFile, but never used serialization already). However I'm still not sure about the fact that can I bring back my data from a file to a structure with an unknown data elements, and beside the file tobe a text not a binary, but your solutions and information about C# were elegant. Thank you again and again.
I will check to find the best design, If I get a good approach, I'll put this class here in CP.
Thank you.
//This is not a signature
while (I'm_alive) {
printf("I Love Programming");
}
|
|
|
|
|
I think I found a solloution,I'm trying to see if it works.
I'll be offline for some days, perhaps!
;)
//This is not a signature
while (I'm_alive) {
printf("I Love Programming");
}
|
|
|
|
|
After seeing the new Office color picker, I began thinking about extending the notion of custom colors to named color sets. The user would select colors into the set of custom colors, and then optionally could save the custom colors to a named color set. The named color sets would be displayed in the color picker directly above the custom colors. (See my article for a screenshot of how it looks now).
Opinions? Comments?
|
|
|
|
|
If you could save a collection of colors by name and then name each color in the collection, that might be useful in some situations.
One situation, for example, might be in a sprite editor. You would name the color collection with the sprite's name, let's say 'Main Battle Tank' and then you could name each color - tracks, engine, barrel, gun, etc. Then these saved color files could be used by anyone doing the graphics editing, if the sprite required updates.
Well, there's my 2 cents.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hi
Please give details about socket communication in VC.
thanx in advance
by
KK
|
|
|
|
|
U can use CSocket class if u have the MFC support
nave
|
|
|
|
|
|
http://www.codeproject.com/internet/
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All,
I am getting an error message saying
"LoadLibrary (abcd.dll failed) - Recursion too deep, Stack overflowed" while registering a COM dll. Can anyone tell me what the problem could be?
Thanks and Regards,
Anil
|
|
|
|
|
I would try if you can load the dll with depends - tool (part of sdk).
This tool will show you if all dependend dll's can be loaded and will report which dll is missing.
Another thing is trying to register the wanted dll by using commandline tool regsvr32 dllname
This will register the com components in registry.
Your dll may tries to register itself when loaded.
|
|
|
|
|
This is only happening when im using a particular function from a library linked to this dll.
Can anyone tell me what the reason could be?
Thanks and Regards,
Anil
|
|
|
|
|
Hello all,
Is there a way to checkpoint a windows process(User Process),rather than just suspend/resume.
What is the core API to be used?
Mention websites which will be of more helpful in this regard.
Thanks in advance.
Rane
Rane
|
|
|
|
|
Perhaps you're after a profiler. MSVC 6 comes with one so I assume the newer ones also do. There are also third partly ones like NuMega’s TrueCoverage.
Steve
|
|
|
|
|
When using CDaoDatabase and CDaoRecordset class.
How to make the database connection with user name and password ?
P.S. using VC6, Dao and Access 2000.
-- modified at 21:02 Friday 24th February, 2006
Is CDaoDatabase and CDaoRecordset
|
|
|
|
|
Hi,
CDaoDatabase and CDaoRecordset is good choice.
In the connection string specify the username and the password.
For more information check this link
DAO[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I found the method at following link.
Open with password
Thank you your help
Remarks
You must call this member function to initialize a newly constructed CDaoDatabase object that represents an existing database. Open associates the database with the underlying DAO object. You cannot use the database object to construct recordset, tabledef, or querydef objects until it is initialized. Open appends the database object to the associated workspace's Databases collection.
Use the parameters as follows:
* If you are opening a Microsoft Jet (.MDB) database, use the lpszName parameter and pass an empty string for the lpszConnect parameter or pass a password string of the form ";PWD=password" if the database is password-protected (.MDB databases only).
* If you are opening an ODBC data source, pass a valid ODBC connect string in lpszConnect and an empty string in lpszName.
For related information, see the topic "OpenDatabase Method" in DAO Help.
|
|
|
|
|
I am trying to use GetSystemWindowsDirectory from an MFC Dll
TCHAR strWinPath[256];
UINT uSize = 256 ;
if(GetSystemWindowsDirectory(strWinPath,uSize))
it gives me a linker error
error LNK2001: unresolved external symbol _GetSystemWindowsDirectoryA@8
I have kernel32.lib included
Any ideas why this could be happenning ?
|
|
|
|
|
Hello ,
Please refer / use the code given from :
http://support.microsoft.com/default.aspx?scid=kb;EN-US;281316
i have used this code in vc 6.0 + Win 2000 Proff.
Its work fine.
Actually the linker problem is due to the finding of exact defination of function with respect to OS call.
Let me know, is that work fine in Your environment , if not can u please tell me detail about ur environment
-- modified at 7:13 Saturday 25th February, 2006
|
|
|
|
|
I hope my toolbar button to have such function.but
I can not do this in classview. Is there any other ways?
Thanks
|
|
|
|
|
Hi,
I dont think you can get some handlers for toolbar doubleclick,but i got an idea:-
1) Map the WM_COMMAND
2) put a static boolean variable inside it at the first click make it true and set a timer .
3) The timer will be to trigger at a fixed time(the time for the second click) nothing hapens in that time set the static variable back to false .
4) kill the timer .
Hope this helps .
Regards,
FarPointer
|
|
|
|
|
Thanks, I will have a try.
|
|
|
|
|
I'm looking to create some sort of database. I need to store details for students and divide them acording to year and class. Having never dealt with any for of database before I'm not really sure how to proceed. My project currently has Excel functions built in, but I'm not sure if storing something like this would be efficient enough using Excel.
Any ideas or suggestions? What databases are easy and fast to learn?
|
|
|
|