|
CEdit::SetSel [^] lloks promising.
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
[My articles]
|
|
|
|
|
just a small ? , where is your Edit COntrol box situated?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
|
Hi,
I have changed my resource file added Dialogs however the change doesn't seem to take
would anyone know Where to specify the .rc file as input to the linker on Visual Studio
|
|
|
|
|
UP!
|
|
|
|
|
Don't understand it must be somewhere on Porperty Pages -> Linker maybe -> input ???
|
|
|
|
|
Hello, I downloaded code written in c which consists of many individual files and routines. I would like to use his code to create a plugin for a 3d animation program.
I program graphics using in C++ and only program for my software's API. To be honest with you, I'm not really sure how to go about it. Would it be possible to create a project as I normally do and import all the c and header files into a c++ project? Or do I have to compile his code? And if I do, what do I compile to? a dll or exe or something else? If I do, how do I access those routines?
As you can probably tell, I am very new at this. Any suggestions will be appreciated.
verb
|
|
|
|
|
if you like, you can add the code to your project without change.
and you also can compile the code to a library to use.
|
|
|
|
|
Thank you kcynic,
Yes, I'd prefer to add the code to my project.
tim
|
|
|
|
|
verbatimline wrote: I would like to use his code to create a plugin for a 3d animation program.
That implies a DLL, doesn't it?
"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
|
|
|
|
|
yes I am creating a dll. My plan is to import all the C routines into my project and call them using my c++ code. Is this possible?
tim
|
|
|
|
|
verbatimline wrote: Is this possible?
Yes, as long as those routines are exported correctly.
"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
|
|
|
|
|
if some of those routines are in the form of a
main (argc, argv) function and these functions are called from another routine, what would be the best way to tie all of them together.
I am assuming the individual main functions are compiled as separate dlls or libs and then work together via some sort of interface?
Sorry for the inexperience, I only program in c++ within a single API.
Tim
|
|
|
|
|
verbatimline wrote: if some of those routines are in the form of a
main (argc, argv)
There is only one main() routine (not plural as you have stated). In any case, it will not exist in your DLL.
verbatimline wrote: Sorry for the inexperience, I only program in c++ within a single API.
All the more reason to start small and work your way into something like a DLL.
"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 David,
You are right. Incorporating C code in my plugin is a big leap for me. But in this case it must be done. I've already learned alot in the process.
Many if not most of the c files have a main(argc, argv) function.
|
|
|
|
|
C and C++ have different naming schemes for function names in object code, so if you try to call a C function "normally" from C++, you'll get an unresolved-external linker error.
So to call a C function from C++, add the 'extern "C"' attribute to its declaration:
extern "C" int myCFunction (int par);
This tells C++ to use the C naming scheme for this function (underscore before the name) rather than the C++ naming scheme (decorated/mangled name).
|
|
|
|
|
|
You can only have one main function. If you need functions in the other files, comment out the extra main methods.
|
|
|
|
|
Hi Alan Thank you for your reply. I was wondering about that. Why would the other c files have a main function? I think the answer lies in the comments of a file with a main function. The coder writes:
I think each c file is a separate little program perhaps?
Tim
modified on Tuesday, April 7, 2009 5:09 PM
|
|
|
|
|
That's what the multiple main () functions would suggest. The important question is whether they have the other functions you need for your application.
|
|
|
|
|
Hi Alan,
Yes, all the basic functions are there. It is up to me to make them work in sequence.
Tim
|
|
|
|
|
In my program I write files out to the disk. When I had the files at this location ("c:\\Wells") I had no problems. Now that the files are located here: ("C:\\Program Files\\WellDB\\Wells") I get this error: "Access Denied"!
Does anyone know why?, and how to solve it?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Probably just because you don't have the privileges to write a file at this location. which platform and which rights are you using ?
|
|
|
|
|
Since I am the owner and only user I would think I could. But what I need to fix is this. When the program installs it does so in the "Program Files" directory, and everything with the program is installed there also. I need to somehow be able to copy directories(a "tree") back to "c:\\" and apparantly MFC VS2008 does not have that kind of ability. I can't tell a customer,"Okay, now use exployer and copy the well directory to "C:\\"" so how do I solve this problem?
A C++ programming language novice, but striving to learn
|
|
|
|
|
I know that in Vista applications that aren't running as an administrator (default) need to be elevated before they can do anything in the C:\Program Files\ directory.. I'm not sure about XP or earlier if you're using that though. Try building a release of your app and running it as administrator and see if it works.
Hope this helps,
--Perspx
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|