|
VonHagNDaz wrote: The majority of the project files are .c,
Which may be why the compiler is complaining about the class keyword.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Aren't most compilers smart enough to cross compile c and c++ files in the same project, or am I confused?
[Insert Witty Sig Here]
|
|
|
|
|
There's nothing wrong with having .c and .cpp files in the same project.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I suppose they're smart enough to consider *.c files as C sources, while *.cpp ones as C++ sources.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: I suppose they're smart enough to consider *.c files as C sources, while *.cpp ones as C++ sources.
correct, but what I'm trying to do is make a class in a .cpp file. Long story short I gave up and I'm using structs now, but structs cant have member functions, so I'm confused. I've only been exposed to OOP in c++, and I've poked c with a 10 foot pole once. I need member functions for the struct, or is that strictly c++ OOP? Google isn't turning up much when I search for member functions for structs, I'm guessing this is a lost cause as well.
dumb programming question #2 :
If I was trying to make a more object oriented approach in c, where would I begin? That might be a basic question, but if you've been reading, all my attempts so far have failed, or are wrong...
moral :
Colleges need more classes on just c and non OOP approaches. In school we had 10+ c++ OOP classes, and one c class where they said "This is c, no one uses it anymore, but now you've been exposed to it..."
[Insert Witty Sig Here]
|
|
|
|
|
Only C++ structs allow member functions (C++ struct s are just classes with different default visibility rules).
Maybe I missed a point: if you need OOP , while are you using C language?
VonHagNDaz wrote: If I was trying to make a more object oriented approach in c,
Use C++ .
C language is best suited for structured programming. There's nothing wrong in following structured programming paradigm: for small projects it is a winning approach. On the other hand, if you need to exploit OOP advantages, you should use an object oriented language, such C++ .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: while are you using C language?
all of the source is in c. This is a massive amount of code I'm maintaining and adding new features to. I thought that I could use .cpp classes, include the .h files in the .c files, and access the object's member functions through pointers. The approach made sense to me, but I guess I'm stuck with c structs and no member functions.
[Insert Witty Sig Here]
|
|
|
|
|
Why don't you upgrade to C++ (i.e. rename from .c to .cpp ) the files wherein you want to use classes?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Why are the simplest answers the hardest to find?
[Insert Witty Sig Here]
|
|
|
|
|
Often posting the right question is difficult.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
This error is typically caused by a missing semi-colon in a class definition. Check the files in included in this source file and see if you missed any semi-color for a class or struct definition.
-Saurabh
|
|
|
|
|
hi
what is the difference between int const valu and const int valu ?
|
|
|
|
|
Member 4278829 wrote: what is the difference between int const valu and const int valu ?
Nothing (unless pointers are involved).
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Maybe I look too beginner for asking:
"From where can I learn how to comunicate with USB ports?"
Thanks for each kind of help...
|
|
|
|
|
That all depends on what type of "communication" you are referring to.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi buddy!
When I close my dialog base app, I encounter an error that says:
"The instruction at "0x45a525" referenced memory at "0x400012". The memory couldn't be "read". Click on OK to terminate the program."
My application cosists of tens of DLLs
could anybody give me an idea to solve this problem PLS...
modified on Monday, March 31, 2008 9:06 AM
|
|
|
|
|
Yes, use your debugger to see more in details what is happening, where the code crashes, the call stack, ...
|
|
|
|
|
Did you use of pointers in your project?
|
|
|
|
|
hi
i prepared one project in dialog based application but i need database suppot for this appl;ication how to solve it?
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
First of all you need to go to "control panel\Administrative Tools\Data Sources (ODBC)" and prepare a DSN (Data Source Name). You should define a path to your database file (e.g MyDatabase.mdb) there.
After that you must add a class to your project, base on ODBC, and define that DSN as database source.
finally costruct an object from new class and enjoy!
Note that you can change the path of your database file in "GetDefault...()"
function within your new database class (Sorry! I couldn't remember the full name of that function )
|
|
|
|
|
You can always do this even after a project has been created by using ClassWizard (Ctrl+W) to derive a class from CRecordset . A DSN (that layer between your code and the database) is nice but it is not necessary.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am stuck trying to develop an application in Visual C++ 6 and MFC. Unfortunately I have ran into a problem before even getting started. When I use the ClassWizard to create a new class for a dialog (or try to use the ClassWizard generally) Visual C++ hangs. It is not possible to exit VC from the task manager or kill the msdev process, It doen't even die if I log off and log in again. The only way to kill it is to press the power button.
The workspace I have created is a dialog based Mfc AppWizard(exe) with 3d controls and ActiveX. I have the same problem with VC6 SP5 and without any sp installed. The computer I use is Windows XP SP2.
Does anybody have an idea what the problem is and what I can do about it?
//Thanks in advance
Martin
|
|
|
|
|
Hi Martin! Probably someone has a better answer... this is just a shot into the blue.
Try to cleanup generated files, they will be recreated automatically when needed. Delete files with the following extension: .ncb .opt .plg .aps .clw - especially the last one always makes problem for me when I add files/classes without using the wizard, I delete it in regular intervals.
If VC crashs you might need to end the hanging process in the task manager, the process is called MSDEV.EXE. That's the quickest solution, if you don't end it you can often not restart VC.
Hope it helps.
/M
|
|
|
|
|
Moak wrote: If VC crashs you might need to end the hanging process in the task manager, the process is called MSDEV.EXE. That's the quickest solution, if you don't end it you can often not restart VC.
Based on the OP's "It is not possible to exit VC from the task manager or kill the msdev process..." comment, he appears to have already tried that.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Based on the OP's "It is not possible to exit VC from the task manager or kill the msdev process..." comment, he appears to have already tried that.
-- Please insert coffee here--
Sorry I completely missed that in the original posting!?! How could I have missed that. I think this summertime change makes me crazier than I thought. I promise to improve my caffeine level before posting.
/M
|
|
|
|