|
V. wrote: yes, kinda, but I don't understand what that's got to do with it.
i dont know MC++, but isn't there any __gc stuff to place somewhere ?
|
|
|
|
|
I've looked into it, but it doesn't work. tnx though, it looked like a good idea...
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Can you be more clear ?
where you have created object of class from dll ?
|
|
|
|
|
I made a dll in C++, I imported it in a C# project (add reference)
I can create the object (MyClass myclass = new MyClass();) but the C# project doesn't seem to know the functions of the class.
tnx.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Let me repeat the things, what you would have done, correct me if i'm wrong
V. wrote: I made a dll in C++, I imported it in a C# project (add reference)
It must be a COM component having IMyClass interface, having some function .
You have added its .tlb in your C# project and used CMyClass class.
If you have followed above steps, then it should not be problem.
Whats error program giving after build ?
|
|
|
|
|
There is no error.
What I have done is loaded the tlb in a C++ project (it didn't load in a C# project).
The C++ project made some classes as a wrapper for the functions exposed by the tlb file.
I compiled the C++ as a dll and imported that dll in my C# project.
So the dll is just a wrapper for the tlb file. Nothing more.
The result is that I can create an object of the class, but none of the functions are visible in intellisense. When I type it manually, the compiler says the function doesn't exist.
My apologies if it wasn't clear.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
V. wrote: What I have done is loaded the tlb in a C++ project (it didn't load in a C# project).
why? it should get loaded. whats error its giving.
V. wrote: I compiled the C++ as a dll and imported that dll in my C# project.
How you have imported this dll ? I think in C# gor using functions from dlls, one need to follow VB way.
|
|
|
|
|
prasad_som wrote: whats error its giving
---------------------------
Microsoft Visual Studio
---------------------------
A reference to 'C:\<path>\filename.tlb' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
---------------------------
OK
---------------------------
prasad_som wrote: How you have imported this dll ?
Same as always: add reference, browse, select the file...
I also did it the VB way (CreateObject, Invoke ...) some functions worked, but not all of them (especially those I needed)
[EDIT]When using the VB way I already tried round about everything, I don't think it will work that way...[/EDIT]
Coulda, woulda, shoulda doesn't matter if you don't.
-- modified at 5:55 Wednesday 12th April, 2006
|
|
|
|
|
V. wrote: ---------------------------
Microsoft Visual Studio
---------------------------
A reference to 'C:\<path>\filename.tlb' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
---------------------------
OK
---------------------------
I'm confused a bit. Actually this error I'm getting while adding dll to my project. .tlb I can add without any problem.
Lost really.
|
|
|
|
|
Well, At least I'm not the only one who's confused here .
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
V. wrote: ...but none of the functions are exposed into the .NET project.
Do you mean exported?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Well, the problem is that I can create the object (with new). But I can't use the functions.
suppose I have a public function called GiveLastError
I would do this in my application:
MyClass myclass = new MyClass();
string error = myclass.GiveLastError();
tnx
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Did you try by exporting the functions directly in the dll?
|
|
|
|
|
I guess no, because I don't really know what you mean by this.
I've often used dll's in my app and in C# I've created dozens, but I've never created a library with C++.
The thing is that I need to use functions exposed by a tlb file. It doesn't load in C# and doesn't work with CreateObject. I can however load it into a C++ app, which worked. All functions are nicely wrapped in a class. I now wanted to use this wrapper as a library for my C# app.
Or so was the idea...
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
it is in VC 2003 with console project I noticed that if run your project in debug mode and then while steping thru the code and setting breakpoints at some places with F9 click and then removing them with the same F9 some of them does not want to disappear completely! It is common that when we click F9 the red circle appear at the line from the left and when we click F9 again the circle is being removed completely, but instead of beign completely diappeared the outline of the circle remains and when we terminate debuging mode all the breakpoints with outlines becomes the real breakpoints!
It is quite inconvinient as many outlined "breakpoints" becomes real breakpoints and I have to remove them manually before next dubug session!
9ine
|
|
|
|
|
A red dot is the breakpoint and a red circle is a disabled-breakpoint. Normally F9 adds/removes breakpoints and doesn't disable them so I'm guessing you will have to change a setting for this.
If you press CTRL B you will be presented with the breakpoint dialog where you can disable/remove them all in one step.
|
|
|
|
|
but I did it before with just F9 and no ctrl+B and they had gone without any circles left? It is just started recently I dont know why.
9ine
|
|
|
|
|
worse, they start to appear at random where I have not put them after running debug mode!
9ine
|
|
|
|
|
That sounds like your debug database is out of sync with your source code. You may need to to a complete rebuild (or clean and build) of your project.
I Dream of Absolute Zero
|
|
|
|
|
|
A red circle appears if the function is out of scope or the breakpoint is not on a valid line.
Check. Is there any mis-match in the dll used and the source code used?
Also check for the tools-options-format settings of ur VC++ IDE.
|
|
|
|
|
I use no dlls
I remeber I changed tool-options-text editor-c/c++ tabs size or something from default 4 to some value and then all tabs shifted in code and I returned 4 again and all restored. I think after that episode bp started to appear spontaniously!
Whats the problem?
9ine
|
|
|
|
|
www.sourceforge.net/projects/tinyxml
I want to insert child items into the xml file
sourse file
aa.xml
<ui>
I want to insert
<property name="weburl" value="http">
into sourse file,how to implement?
Have inserted file
<ui>
<property name="weburl" value="http">
|
|
|
|
|
chybin wrote: into sourse file,how to implement?Have inserted file
show your implementation
|
|
|
|
|
Hi:
I am a newbie in VS C++.NET. A silly question. How can I compile a single C++ file and build a solution downloaded from Internet please?
Thanks in advance!
Asura
|
|
|
|