|
bob16972 wrote: I'd email you an egg McMuffin if I could.
Heh. I'd eat it if you could!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
*scratches head*
In c++ how do you load in a class library? And more to the point, can i load a DLL made with C#?
I am using OpenGL and the GLUT library, so i've never needed to waste time setting up windows and other such like. I thought, maybe if i just make a couple of things in C# put it into a dll then load it up.
Currently the project is just c++, there's no .Net framework involved. So err, any articles on the subject would be great. Although i suppose i could settle with just a working code snippet
I'm also using MS VC++ 6, if that relevant at all.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
I'm not a C# programmer, but I'm pretty sure a C# DLL is a managed assembly.
To interface your C++ code with a managed assembly, you'll need to use C++
code compiled to CLR. That means you need VC .NET or VC 2005+.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Zoom...
What was that? It was Mark, replying super quick!
I guess i'll not bother then, It's not worth the time, or extra effort.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
is there a limit on the number of files we keep open simultaneously?
Tnx
Tzumer
|
|
|
|
|
It depends on what you're using to open the files and what OS you're on,
what resources are available at any given time, etc.
For CRT file I/O (stdio) see _setmaxstdio()[^]
For Win32 APIs (CreateFile), I would guess thousands - try it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If you have to ask that question you've probably got a dubious design.
Steve
|
|
|
|
|
I have a template function that returns a variable of type T.
Here is the signature of that function:
T GetData();
When everything goes well, GetData() perform some tasks then returns a valid variable of type T.
Sometimes, for different reasons, the function cannot return a valid variable of type T. In these cases, I would have like to return NULL to notify the calling function that GetData() could not 'get' any 'data'.
Here is my problem:
I cannot return NULL since type T could be a int, a CString, a MyCar, a pointer or anything.
So I declare a local variable of type T inside the GetData() function, load it with stuff when possible, and return this local variable at the end of the function.
The problem is now that sometimes, my software crash with an exception telling me that I'm using a local variable that has not been initialized.
Also, I cannot just 'initialize' it as I would with any other kind of variables since this one is of type T, it could be anything.
Anyone has an idea how to get around this problem?
Thanks!
Benjamin Racette
CAE software developer
racette@cae.com
|
|
|
|
|
Throwing an exception ? That will avoid a lot of troubles I think.
|
|
|
|
|
Cedric Moonen wrote: Throwing an exception
That is pure genius!
Of course!
I can't believe I didn't think about it.
Thanks a lot!
Benjamin Racette
CAE software developer
racette@cae.com
|
|
|
|
|
Hello,
does anyone has any idea to get current url from firefox?
thanks
|
|
|
|
|
Does it have a COM interface?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think mozilla firefox doesnt have com interface, that is why it is hard to get url from mazilla
|
|
|
|
|
Gofur Halmurat wrote: I think mozilla firefox doesnt have com interface, that is why it is hard to get url from mazilla
You should ask same question in MOZILA forums, you will got lot of reply there, if you have asked about IE here, you will getting lots of reply here!
"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
|
|
|
|
|
Hello
It uses Xpcom technology(cross plotform technology) it is like ms com, but little bit diffirent, have u ever used xpcom in your project before?
thanks
|
|
|
|
|
I was wondering if explicitly casting a variable of type int
to a variable of type char, is identical to assigning an int to a char variable?
Again, Tnx
Tzumer
|
|
|
|
|
e.tzumer wrote: I was wondering if explicitly casting a variable of type int
to a variable of type char, is identical to assigning an int to a char variable?
could you show an example?
|
|
|
|
|
c - char
i - integer
<br />
c = (char)i;<br />
VS<br />
c = i;<br />
Tzumer
|
|
|
|
|
e.tzumer wrote: if explicitly casting a variable of type int
to a variable of type char, is identical to assigning an int to a char variable?
Both of your examples are assignment operations. One is an implicit cast the other an explicit cast. Perhaps you should do some reading on the subject[^].
|
|
|
|
|
is the standard input file (stdin) always the keyboard?
is the standard output file (stdout) always the screen?
is the standard error file (stderr) always the screen?
Thanks
Tzumer
|
|
|
|
|
no, that are their defaults.
you can modify a program's stdin/stdout/stderr in many ways.
e.g. change stdout by invoking it from a DOS prompt with a > as in
prompt> mycommand /options > outputfile
that is how you can "dir" to a file.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
|
stdin and stdout can both be redirected. I'm not sure if stderr can or not.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
command 2> error.log
Search Windows Help (Start Menu -> Help) for "Using command redirection operators".
The numbers before > are:
STDIN 0 Keyboard input
STDOUT 1 Output to the Command Prompt window
STDERR 2 Error output to the Command Prompt window
Florin Crişan
|
|
|
|
|
I have the following code to read data from a list of files. The code read the first file and read the data correctly. I used break point debug and found at "fclose(f_ptr2)" giving error: "Access Violation"
Please help and many thanks to Gurus.
FILE *f_ptr2;
//
for (int ii=0;ii
|
|
|
|