Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need help with compiling warnings that might cause memory error

Posted on 2006-11-13
3
Medium Priority
?
755 Views
Last Modified: 2008-01-09
Hi I'm using vs2005.  I am getting a bunch of compiler warnings after I made
some changes to my code that was compiling clean.  I'm also getting memory
errors when I run my program and it's pinvoking some C++ code, which was
working also fine before.  I wonder if these warning are causing the problem.
 I would appreciate some help or suggestions on how to correct these.  Thanks.

Warning      37      At least one of the arguments for
'IADsExtension.PrivateGetIDsOfNames' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      39      At least one of the arguments for
'IDirectoryObject.GetObjectAttributes' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      38      At least one of the arguments for
'IDirectoryObject.GetObjectInformation' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      40      At least one of the arguments for
'IDirectorySchemaMgmt.EnumAttributes' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      41      At least one of the arguments for
'IDirectorySchemaMgmt.EnumClasses' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      47      At least one of the arguments for 'IGetAppData.GetAppData' cannot
be marshaled by the runtime marshaler.  Such arguments will therefore be
passed as a pointer and may require unsafe code to manipulate.
Warning      46      At least one of the arguments for 'IGetAppData.GetApps' cannot be
marshaled by the runtime marshaler.  Such arguments will therefore be passed
as a pointer and may require unsafe code to manipulate.
Warning      48      At least one of the arguments for 'IGetAppData.GetCLSIDData'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      27      At least one of the arguments for
'IPrivateDispatch.ADSIGetIDsOfNames' cannot be marshaled by the runtime
marshaler.  Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
Warning      32      At least one of the arguments for 'ITypeComp.RemoteBind' cannot
be marshaled by the runtime marshaler.  Such arguments will therefore be
passed as a pointer and may require unsafe code to manipulate.
Warning      29      At least one of the arguments for 'ITypeInfo.RemoteGetFuncDesc'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      28      At least one of the arguments for 'ITypeInfo.RemoteGetTypeAttr'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      30      At least one of the arguments for 'ITypeInfo.RemoteGetVarDesc'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      36      At least one of the arguments for 'ITypeLib.RemoteGetLibAttr'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      44      At least one of the arguments for 'TrackerServer.GetAppData'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Warning      43      At least one of the arguments for 'TrackerServer.GetApps' cannot
be marshaled by the runtime marshaler.  Such arguments will therefore be
passed as a pointer and may require unsafe code to manipulate.
Warning      45      At least one of the arguments for 'TrackerServer.GetCLSIDData'
cannot be marshaled by the runtime marshaler.  Such arguments will therefore
be passed as a pointer and may require unsafe code to manipulate.
Error      49      Invalid token '=' in class, struct, or interface member
declaration      C:\Projects\UnityAdmin\Main.cs      150
Warning      2      The private field
'UnityAdmin.FormMain.ERROR_OBJECT_ALREADY_EXISTS' is assigned but its value
is never used      C:\Projects\UnityAdmin\Main.cs      149
Warning      3      The private field 'UnityAdmin.frmConnectToDomain.domControllers'
is never used      C:\Projects\UnityAdmin\ConnectToDomain.cs      17
Warning      5      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0002.lpValue'.
Warning      7      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0003.lpValue'.
Warning      9      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0004.lpValue'.
Warning      14      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0011.Address'.
Warning      16      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0012.ReplicaAddressHints'.
Warning      18      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0013.Parameters'.
Warning      20      The type library importer could not convert the signature for the
member '__MIDL___MIDL_itf_ads_0000_0015.lpBinaryValue'.
Warning      21      The type library importer could not convert the signature for the
member '_ads_attr_info.pADsValues'.
Warning      10      The type library importer could not convert the signature for the
member '_ADS_CASEIGNORE_LIST.Next'.
Warning      23      The type library importer could not convert the signature for the
member '_ads_class_def.ppszMandatoryAttrs'.
Warning      25      The type library importer could not convert the signature for the
member '_ads_class_def.ppszNamingAttrs'.
Warning      24      The type library importer could not convert the signature for the
member '_ads_class_def.ppszOptionalAttrs'.
Warning      26      The type library importer could not convert the signature for the
member '_ads_class_def.ppszSuperClasses'.
Warning      12      The type library importer could not convert the signature for the
member '_ADS_OCTET_LIST.Data'.
Warning      11      The type library importer could not convert the signature for the
member '_ADS_OCTET_LIST.Next'.
Warning      19      The type library importer could not convert the signature for the
member 'ADS_DN_WITH_BINARY.lpBinaryValue'.
Warning      17      The type library importer could not convert the signature for the
member 'ADS_FAXNUMBER.Parameters'.
Warning      13      The type library importer could not convert the signature for the
member 'ADS_NETADDRESS.Address'.
Warning      6      The type library importer could not convert the signature for the
member 'ADS_NT_SECURITY_DESCRIPTOR.lpValue'.
Warning      4      The type library importer could not convert the signature for the
member 'ADS_OCTET_STRING.lpValue'.
Warning      8      The type library importer could not convert the signature for the
member 'ADS_PROV_SPECIFIC.lpValue'.
Warning      15      The type library importer could not convert the signature for the
member 'ADS_REPLICAPOINTER.ReplicaAddressHints'.
Warning      22      The type library importer could not convert the signature for the
member 'ads_search_column.pADsValues'.
Warning      31      The type library importer could not convert the signature for the
member 'tagARRAYDESC.rgbounds'.
Warning      42      The type library importer could not convert the signature for the
member 'tagBLOB.pBlobData'.
Warning      34      The type library importer could not convert the signature for the
member 'tagFUNCDESC.lprgelemdescParam'.
Warning      33      The type library importer could not convert the signature for the
member 'tagFUNCDESC.lprgscode'.
Warning      35      The type library importer could not convert the signature for the
member 'tagPARAMDESC.pparamdescex'.

--
Thanks.
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 17937755
Did you mix C# code with managed/unmanaged C++ code?

>>>> Main.cs

the .cs extension is reserved for C# code ???


Unfortunately I don't know of C# and little of managed C++. But AFAIK you should try to use pure managed code if you don't want to dive into a swamp called 'marshalling'.

Regards, Alex

0
 

Author Comment

by:lapucca
ID: 17944424
Yes Alex, I am pinvoking dll that are written in C++.  I also pinvok dll written in C.  All these dlls can not be written in C# so I can only try to deal with it.  thank you.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 2000 total points
ID: 17944906
>>>> All these dlls can not be written in C#

Yes, but I think they can't be written in managed C++ as well. You have to write them in unmanaged C++ or in C and call them from managed C++ or C# by means of the marshaler.

Regards, Alex
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question