CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    3

    instanciate an unmanaged class in a Winfows Form

    Hello,
    I like to use an unmanaged class in a Windows Form, when including its header, and entring the following code
    Code:
    #pragma endregion
     
    	private: PacketAfdx *P;
     
    		private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) 
    			 {
    				P->traficCapture();
     
    			 }
    I have this error message
    Code:
    c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C3699: '*' : cannot use this indirection on type 'IServiceProvider'
    1>          compiler replacing '*' with '^' to continue parsing
    1>c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103): error C2371: 'IServiceProvider' : redefinition; different basic types
    1>          c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(120): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(241): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(251): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
    1>c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6459): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
    1>c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6461): error C2872: 'IServiceProvider' : ambiguous symbol
    1>          could be 'c:\program files\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
    1>          or       'c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll
    Please how can I use my unmanaged class?
    Thanks

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: instanciate an unmanaged class in a Winfows Form

    Does this help: http://social.msdn.microsoft.com/For...b-e8d895a9faec? (It was the first hit of an MSDN search for servprov.h. )
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Apr 2012
    Posts
    3

    Re: instanciate an unmanaged class in a Winfows Form

    Non ça n'a pas marché le meme erreur persiste

  4. #4
    Join Date
    Apr 2012
    Posts
    3

    Re: instanciate an unmanaged class in a Winfows Form

    I'm very sorry for using French;
    My error still exist after changes entring following you link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured