|
It seems that you have lacks in knowledge about programming basics (in general) and C/C++ basics... I think the best for you is to buy a good book
|
|
|
|
|
Don't know where you are coming from and where you are going ...
This is very basic beginner C/C++
Go back to your class notes (books) and re-read all of them, especially the first few chapters.
because I'm an easy going guy and did not got a lot of sleep because of overly chatty neighbors (they were awake 'till 5am) I'm going to help you a little bit...
1. just call the function.
VOID abcFunc()
{
}
void ABC() {
abcFunc();
}
2.
who defines ABC() ? who calls that function ?
what is dwInstance ?
is the method abcFun() defined in the CExampleDlg class ?
void ABC() {
CExampleDlg *pointer = (CExampleDlg*) dwInstance;
pointer->abcFunc();
}
Good luck ... keep going... and don't forget to drink a lot of water, it's good for you.
M.
Watched code never compiles.
|
|
|
|
|
Hi everybody,
I am using shock wave flash control on a dialog. I able to play the movie file(.swf file) But I want to make the background as transparent while playing the swf file.There is an article named "transparent flash control in plain C++" that solved this problem, but the usage of cpu is too high.Does someone have a solution?
Thanks!
|
|
|
|
|
I use CodeBlocks 10.05, I want use C dll in .NET.
I write following code in CodeBlocks 10.05 compiler, but get error when I build it.
#include <stdio.h>
extern "C" __declspec(dllexport) int GetLuckyNumber()
{
return 13;
}
ERROR MESSAGE
error: expected identifier or '(' before string constant
|
|
|
|
|
Hi,
I've never seen extern "C" without curly brackets, so try
extern "C" { ... unmangled C code here ...}<br />
|
|
|
|
|
extern "C" will work without curly brackets.
Curly brackets are required if you need to include multiple lines in the scope of extern "C" .
|
|
|
|
|
If we're being picky here, the actual condition is not "multiple lines" but "more than a single declaration". Refer section 7.4 of the standard. For example,
extern "C"
double
sqrt(
double)
;
is OK, but
extern "C" double sqrt(double); double exp(double);
and
extern "C" int square(int x) {return x*x;}
are not.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
What compiler do you use in your IDE environment?
I think __declspec(dllexport) is only for MS compiler, not for gcc.
|
|
|
|
|
|
If you're using gcc file.c from the command line, then that could be the problem - gcc is the C compiler and extern "C" is C++ code.
Use g++ file.c , or make sure the file extension is .cpp or .c++ for gcc to compile it as C++.
|
|
|
|
|
This is just the solution for original question, I think.
|
|
|
|
|
Check the line number where the error occurs and post the code.
The code that you've posted here has the correct syntax.
|
|
|
|
|
|
Try binning the extern "C" off the front of the function. If that compiles without error then enclose the lot in a extern "C" {} block.
Cheers,
Ash
|
|
|
|
|
I don't want to check a path if it exists, I would like to use some type of command to query if a drive actually exists before I do any maniplulation or anything else on it, like X:, G: ...etc
Thanks
|
|
|
|
|
|
Have you tried _chdrive() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Use can use the PathFileExists API.
|
|
|
|
|
MFS System Utility[^]
"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
|
|
|
|
|
delete
modified 2-Apr-21 5:21am.
|
|
|
|
|
I am not sure that I understand your question but if you have Visual Studio 2010 then you can code in C, C++ or C#. Perhaps you could rephrase your question or show the code that you are having trouble with.
It's time for a new signature.
|
|
|
|
|
How can i code/compile C?
What project i must open?
|
|
|
|
|
Which version of Visual Studio do you have?
Ultimate / Pro or VC++ Express?
Please check my other reply to this question.
--
"Programming is an art that fights back!"
|
|
|
|
|
|
what I do (using VS Express) in such case is create a C++ project of the kind you want, then add a file with extension .c and finally remove the ones with extension .cpp; I typically also have to change the settings about precompiled headers.
I wish there were an easier way, but I don't see one.
|
|
|
|