|
dawei.code wrote: But the versioning of the libraries should be recognized as the same, shouldn't it?
Yes, unless you don't build the main application and the plugin project together. A "Build Solution" command (assuming both of them are in the same solution) should take of this problem, if it is the reason.
dawei.code wrote: I will try putting everything into one folder, and I will tell you if it worked or not. The target of my project however was to keep the plugins in an extra folder. Would there be a way to achieve this?
Yes, there are plenty of articles in the internet, just Google for "C# Plugins", you can easily translate the idea to C++/CLI.
dawei.code wrote: 'assembly' stands for DLLs and EXEs in .NET, right?
Yes, but assemblies need not be .dll or .exes. .NET supports multifile assemblies (although VS .NET doesn't), which means you could have code and resources for a single assembly spread across modules.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Hi again,
keeping the DLLs together made it (of course I might say). So thank you very much. Fort the moment I can continue. Let's see what else will happen in that course. I also tried the copylocal=false advice, but this brought more problems than I want to take now.
Thank you again and best regards,
dawei
|
|
|
|
|
i've created one DLL (testlib) and i want to use it in my application as an array of its instances ...
i'm getting an exception as
'System.NullReferenceException'
plz consider the following code ..
//-------------------------------------------------------------------------
testlib::testlibControl *tmp1 __gc[];
for(int i = 0; i < strength; i++)
{
tmp1[i] = new testlib::testlibControl;
tmp1[i]->Location = System::Drawing::Point(x,y); //exception
tmp1[i]->Size = System::Drawing::Size(24, 29);
x += 30;
this->Controls->Add(tmp1[i]);
}
//-------------------------------------------------------------------------
Why does this code cause exception?
Thanks,
Kranti
|
|
|
|
|
Hi,
I might be wrong but most likely you forgot to initialize your array.
testlib::testlibControl *tmp1 __gc[];
// add the following
tmp1 = __gc new testlib::testlibControl*[strength];
for(int i = 0; i < strength; i++)
{
...
However with the new Syntax it should be something like this:
array<testlib::testlibControl^>^ tmp1 = gcnew array<testlib::testlibControl^>(strength);
Furthermore i do strongly recommend to use the new syntax, because it is far more easy to read.
best regards Tobias
|
|
|
|
|
ok .. i've made required changes as follows but still i'm getting the
same exception
testlib::testlibControl *tmp1 __gc [];
tmp1 = new testlib::testlibControl* __gc [10];
for(int i = 0; i < strength; i++)
{
tmp1[i]->Location = System::Drawing::Point(x,y); //exception
....
...
}
Thanks,
Kranti
|
|
|
|
|
Hmm,
is it correct that your testlibcontrol class is unmanaged?
I mean, as far as i know it should be like this if it's a managed one:
testlib::testlibControl __gc* tmp1 __gc [];
Though i suppose you have created a managed array of unmanaged testlibcontrol pointers? However you said that it is crashing on this line:
tmp1[i]->Location = System::Drawing::Point(x,y); //exception
Therefore it can be only one of the two things, either x or y have not been initialized (which is very unlikely) or your array is not properly initialized. IMHO it is related to the second one. Therefore I would suggest that you'll have a close look into your testlibcontrol class (constructor etc.) and the initialization of that array again. Furthermore you should step through your code with the debugger and check if it has really initialized an object of the type testlibcontrol here:
tmp1[i] = new testlib::testlibControl;
regards Tobias
|
|
|
|
|
hey,
thanks a lot .. this type of initialization worked for me ...
testlib::testlibControl *tmp1[] = __gc new testlib::testlibControl*[10];
tmp1[i] = new testlib::testlibControl;
tmp1[i]->Location = System::Drawing::Point(x,y);
tmp1[i]->Size = System::Drawing::Size(24, 29);
Thanks,
Kranti
|
|
|
|
|
How to write and read an object of user defined class into file.
|
|
|
|
|
this is called serialization.
i think that if you posted your question here, it's because you'd like to do it in Managed C++.
i don't have the solution, but there is certainly some articles about how to Serialize/Deserialize class instances.
|
|
|
|
|
I am using Borland C++ (v4.5) and trying to write a program to input output one byte to the parallel port. It used to be fairly easy prior to XP. I have seen various things on the web that are supposed to get around the hard bit of overriding XP's control over the port, e.g.
www.geekhideout.com/iodll.shtml
but I can't get them to work. I think I must be doing something wrong in the way I include the .h and .dll files into the project. What is the difference between starting an ordinary .cpp program and a project.
Can anybody offer me some advice please
Geoff
|
|
|
|
|
|
I am currently using Visual Studio 2003, I see that when I choose a new project for C++ I can not pick any project to develop on a mobile device. C# has this option.
Is it possible to build an application in C++ with managed extension (with \clr ) for mobile development? If so does anybody got a link or so to point me in the right direction?
Greetings,
Davy
|
|
|
|
|
hi everyone i have a project like that :
You are supposed to develop a garage system simulator. Possible system classes are car owner, car, garage, fee, payment.
Take into account the following assumptions:
1- A customer may take parking , washing, polishing services.
2- There is predefined parking fee list. Important point is to hold time chart for a car.
3- Washing service choices are outer or all.
4- Payment includes all services.
5- Manager should be able to check the numbers of car and the money. This report may be taken daily or for a duration.
please help.
if you write c++ code i will be so presuade. thanks a lot.
-- modified at 11:50 Tuesday 4th April, 2006
|
|
|
|
|
Sir,
You need to start writing your simulator application. While you are programming and you have a specific question on coding, please post your question here if you are using Managed C++ or C++/CLI. Otherwise, not too many developers are "nice" enough to write this project for you.
George
-- modified at 18:45 Tuesday 4th April, 2006
|
|
|
|
|
do your homework yourself
|
|
|
|
|
Did you read this[^] before posting ?
-- modified at 5:08 Wednesday 5th April, 2006
Link corrected
|
|
|
|
|
ok guys, i will start my project and if i have a specific question i will ask it. thanks a lot.
|
|
|
|
|
I`m writing a dll in C++ that uses managed extensions. Its purpose is to wrap a .NET library I wrote so that I can use it in an existing C++ project I have here.
All goes smooth, but I got some problems now calling a C# function of the dll that has an out parameter.
function definition in C#:
public enumMsgType DoYourThing(string sMethod, ref Single Cnt, out string outParam, string inParam)
my wrapper function is:
CMyWrapperObj::wrMessageType CMyWrapperObj::InvokeMethod( LPCTSTR sMethod, float& nNum1, CString& sOutParam, LPCTSTR sInParam)<br />
{<br />
return static_cast<CMyWrapperObj::wrMessageType>((*this)->InvokeMethod(sMethod, &nNum1, sOutParam,sInParam));<br />
}<br />
I get a build error on the sOutParam parameter:
MyWrapper.cpp(60) : error C2664: 'COMCaller::ManagedObj::DoYourThing' : cannot convert parameter 3 from 'CString' to 'System::String __gc *__gc * '
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
So I guess I need to call this function not with a CString parameter.. .I also tried a std::string variable to pass in the parameter list, but also that doesn^t work... It`s probably something obveous that I`m overlooking, but if you could point me to it I would be gratefull
Greetings,
Davy
|
|
|
|
|
why don't you use LPCTSTR parameter, or ever simple, System::String ?
|
|
|
|
|
LPCTSTR because the string isn^t a constant, it will get a new value in the .NET function that will be called.
System::String .. Since I don^t want to have any managed types in my header files I guess my mind didn^t get to that point.
Well thanks a lot, got the thing compiled now, I can now focus on the next issue!
|
|
|
|
|
Hi,
I've to write a query which requires a function similar to "sprintf" in C
For e.g.
String *query; // in c++.net
sprintf(query, "Select * from table_name where number = %d", no); // in C
How can this be done in this environment?
Thanks,
Kranti
|
|
|
|
|
Kranti1251984 wrote: I've to write a query which requires a function similar to "sprintf" in C
For e.g.
String *query; // in c++.net
sprintf(query, "Select * from table_name where number = %d", no); // in C
How can this be done in this environment?
Hi Kranti1251984,
yes, there is actually. For instance you could use:
System::String::Format(...)
<br />
String^ s = String::Format(<br />
"(C) Currency: . . . . . . . . {0:C}\n" +<br />
"(D) Decimal:. . . . . . . . . {0:D}\n" +<br />
"(E) Scientific: . . . . . . . {1:E}\n" +<br />
"(F) Fixed point:. . . . . . . {1:F}\n" +<br />
"(G) General:. . . . . . . . . {0:G}\n" +<br />
" (default):. . . . . . . . {0} (default = 'G')\n" +<br />
"(N) Number: . . . . . . . . . {0:N}\n" +<br />
"(P) Percent:. . . . . . . . . {1:P}\n" +<br />
"(R) Round-trip: . . . . . . . {1:R}\n" +<br />
"(X) Hexadecimal:. . . . . . . {0:X}\n",<br />
-123, -123.45f); <br />
Console::WriteLine(s);<br />
In addition i would like to point out, that it would be more secure to use parameters when constructing dynamic SQL statements.
best regards Tobias
|
|
|
|
|
2beeIn addition i would like to point out, that it would be more secure to use parameters when constructing dynamic SQL statements.
Just to add to Tobias' quoted comment, SQL Injection can be a big problem. For instance, a user can "inject" a DELETE statement into your programmically built SQL string and do some serious damage. Using parameters, SQL injection is impossible.
|
|
|
|
|
Hello,
Is it possible to include a .dll in a /clr:pure project?
I am currently using unmanaged code for this.
I was wondering if it is also possible with a /clr:pure project which does not allow native C++?
Including a .dll can be done with C#.
(Full setting is "Pure MSIL Common Language Runtime Support (/clr:pure)" in the project properties -> General)
best regards,
Jan Timmerman
|
|
|
|
|
What do you mean by 'include a dll'?
If ur question is whether an unmanaged dll can be used in a /clr:pure c++/cli project, Yes, You can do. Inlcude the lib and header file to c++/cli project and you can create objects of unmanaged clasees in the dll or u can call unmanaged functions in that dll.
You can use a com dll as well using the #import
c++/cli is the only language where u can mix both managed unmanaged code.
deoes this make sense...mil10.
|
|
|
|