|
Nish he was trying to call managed dll from an unmanged win32 dll. thats why the err.
rgds..milton.
|
|
|
|
|
Hello
im working with MSMQ , so i want to make dll that will send to MSMQ,
so how can i include MSMQ Library (System.Messaging.dll) in VC++ ?
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll
thanks
|
|
|
|
|
you can use #using directive to include the managed dlls into your code.
Then use the namespace declaration and create the class instance. See the sample below.
#using <system.messaging.dll><br />
using namespace System::Messaging;<br />
<br />
if ( !MessageQueue::Exists( queuePath ) )<br />
MessageQueue::Create( queuePath );<br />
cheers..milton
|
|
|
|
|
thank you
i tryed it but it give me this error:
Error 1 fatal error C1190: managed targeted code requires a '/clr' option
can you know how to resolve it ?
|
|
|
|
|
Project Properties -> configuration Properties -> General -> Common Language runtime support
set-->Common Language Runtime Support (/clr)
but also it gives me this error:
Error 1 Command line error D8016 : '/MTd' and '/clr' command-line options are incompatible cl
how can i fix it please ?
|
|
|
|
|
Error 1 Command line error D8016 : '/MTd' and '/clr' command-line options are incompatible
'/MTD' is the Multithreded C Runtime debug version. That means you chose an unmanaged project type. What kind of project you are working on ?
If you need to call .net libaries from an unmanaged type, best way is to wrap all ur bussiness rules into an assembly and use CCW - Com callable wrapper to invoke the wrapper .net component from ur unmanaged app.
Or else change the project type to a managed.
rgds...milton.
|
|
|
|
|
actually i created my project with VC6++, the Convert and open project with VC2005, emm ok i will try to open new fresh project from 2005 directly , so i have to open managed dll project from vc2005.
can you tell me which option when i want to create project give me managed dll ? currently i make win32 project--->dll with puting sign on Export symbols only.
is im in right way ?
-- modified at 17:42 Saturday 6th May, 2006
|
|
|
|
|
i think yes im in safe side ,
now i can compile with no errors after set Common Language Runtime Support (/clr), i want to know if there is any changes between dll on vc6++ and vc2005,
everytime i call function within dll by using this declaration
int _stdcall SendToQueue(char * SBody,char * SLabel)
{
return 123;
}
and i have to make .def file and write exported function header inside it
so it will work with vc2005 or there is problem with it ?
|
|
|
|
|
You were in the wrong side.
you again choose an unmanaged project type because win32 project is an unmanged type.
After all what you need is to call MSMQ APIs right? You can do it in two ways:
1) Either use unmanaged MSMQ Apis
2) Or use Managed .Net class libraries, which is the one you chose.
For the first option:
you can go for an unmanaged project type. ie it can be a vc++6 project or a VC++8 MFC application.
Then for accessing the MSMQ apis go thru http://www.thecodeproject.com/w2k/msmq.asp.
This method will be fater as MSMQ apis are unmanged and you are directly dealing with the apis.
Second option is to use managed dlls:
This is the option you chose, by using System.Messaging.dll. This is not that good as the previous one as it wrapes the actual MSMQ COM Apis under the hood.
If you want to go for this option yu can do it in the following ways:
a)Use an Unmanaged VC++ app and use interop for calling the wrapper u created on managed
System.Messaging.dll. For this you have to create one managed wrapper dll (New project -->
Visual C++ -->CLR --> Class library) and wrap all your msmq requirements using
System.Messaging.dll functions.Then use COM iterop to use this managed wrapper dll from ur
Unmanaged VC++8 application.
(Or you can avoid wrapper dll by using CorBindToRuntimeEx(), but more complicated. better dont
go for this if u r beginner).
b)USe a Managed VC++ application (New project --> Visual C++ -->CLR --> Windows forms applicaion /
Class library). This is a c++/cli application.
This will be the easiest methed if you are planning to use System.Messaging.dll (in C++) instaed
of the MSMQ COM apis.
Or another choice is, you really want to go for vc++? if you go for C# and System.Messaging.dll then it will be the easiest of all.
more questions are welcome ...milton
|
|
|
|
|
i think it works with option :
b)USe a Managed VC++ application (New project --> Visual C++ -->CLR --> Windows forms applicaion /
Class library). This is a c++/cli application.
This will be the easiest methed if you are planning to use System.Messaging.dll (in C++) instaed
of the MSMQ COM apis.
--------
Thank you Milton finally its works
|
|
|
|
|
had gone for a short hiking to Wachusett Mountain MA. Just back now. sorry for abt the delay buddy.
Be aware that the option u selected is managed c++ (c++/cli) app and not a typical vc6++ like unmanaged application.
cheers..milton.
|
|
|
|
|
The Microsoft Most Valuable Professional (MVP) Program recognizes and thanks outstanding members of technical communities for their community participation and willingness to help others. The program celebrates the most active community members from around the world who provide invaluable online and offline expertise that enriches the community experience and makes a difference in technical communities featuring Microsoft products.
I've been asked by Microsoft to nominate North American Visual C++ developers deserving of Microsoft MVP status. Please make your nominations here or email me at webmaster@codeproject.com.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: I've been asked by Microsoft to nominate North American Visual C++ developers
i am C++ developper and would be soooo happy to be MS MVP, but i'm not living in North America
do you know why they look for north america developers only ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
They have MVPs all over the world. They are not only looking for North America MVPs.
gmileka
|
|
|
|
|
toxcct wrote: i am C++ developper and would be soooo happy to be MS MVP, but i'm not living in North America
do you know why they look for north america developers only ?
No, you are not ruled out at all. MVPs are not restricted to the US and Canada. I got awarded first in Oct 2002 and I was in Trivandrum, India at that point.
Regards,
Nish
|
|
|
|
|
Chris Maunder wrote: I've been asked by Microsoft to nominate North American Visual C++ developers deserving of Microsoft MVP status.
Recently I saw a thread where they were specifically looking for VC++ MVPs outside North America.
Regards,
Nish
|
|
|
|
|
Hi Nishant,
I would like to know how to apply for MVP.( just for knowing..I still not upto that level ). I from India->Trivandrum->Technopark..
nave
|
|
|
|
|
|
ppatel567 wrote: microsoft is about to kill mfc for all times
Microsoft officially announced this?
nave
|
|
|
|
|
i dont know ask roger. he wrote so. He has shaken all mfc programmers.
|
|
|
|
|
ppatel567 wrote: i dont know ask roger. he wrote so. He has shaken all mfc programmers.
Good heavens! That Roger needs to stop shaking up MFC programmers!
Regards,
Nish
|
|
|
|
|
Naveen R wrote: Hi Nishant,
I would like to know how to apply for MVP.( just for knowing..I still not upto that level ). I from India->Trivandrum->Technopark..
nave
If you are in India, Sri Lanka, or Bangladesh, you can nominate yourself to the India MVP programme - it's the only programme that allows self nomination.
If you live outside those 3 countries, someone has to nominate you. Some people usually just ask a friend to nominate them.
Of course, you must have some minimum level of community participation. The Code Project boards are a good way to begin - every year, a few people get awarded based on their contributions to CP.
Regards,
Nish
|
|
|
|
|
Nishant Sivakumar wrote: If you are in India, Sri Lanka, or Bangladesh, you can nominate yourself to the India MVP programme - it's the only programme that allows self nomination.
you are safe as ALLEN is not here ... you forget NEPAL!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: you are safe as ALLEN is not here... you forget NEPAL!
Oops
Regards,
Nish
|
|
|
|
|
Hello,
I'm trying to convert a string "CtrlA" to a System::Windows::Form::Shortcut. I've seen examples in C# for doing this:
menuItem_action.Shortcut = (Shortcut)Enum.Parse(typeof(Shortcut), txt);<br />
That seems simple, but I haven't had luck doing it in MC++. Here's my code (broken into seperate lines for easier reading:
Type* tp = __typeof(Shortcut);<br />
Object* obj = (Enum::Parse(tp, txt));<br />
Shortcut* scut = static_cast<Shortcut*>(obj);<br />
menuItem_action->set_Shortcut(*scut);
I get the compilation error:
c:\projects\TestForms\HotKey\Form1.h(210): error C2440: 'initializing' : cannot convert from 'System::Object __gc *' to 'System::Windows::Forms::Shortcut __gc *'
I'm not sure how to convert the parsed value to a Shortcut. Can anyone shed some light on this? Thanks.
|
|
|
|