Solved

Compiler Warning (VS 2008 Pro, C#)

Posted on 2009-07-13
6
1,435 Views
Last Modified: 2012-06-21
I am getting over x50 of these sort of warning in the compiler (VS 2008 Pro, C#).  There are no line numbers to refer too.

How do I address these?


Warning      1      

At least one of the arguments for 'SpStreamFormatConverter.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
0
Comment
Question by:amillyard
[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
  • 4
  • 2
6 Comments
 

Author Comment

by:amillyard
ID: 24839292
here is the list of the other similer compiler errors (in case there is a link etc).
Warning	56	At least one of the arguments for 'IInternetSecurityManager.QueryCustomPolicy' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	57	At least one of the arguments for 'IInternetSecurityMgrSite.GetWindow' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	9	At least one of the arguments for 'ISpAudio.GetDefaultFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	8	At least one of the arguments for 'ISpAudio.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	7	At least one of the arguments for 'ISpMMSysAudio.GetDefaultFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	6	At least one of the arguments for 'ISpMMSysAudio.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	17	At least one of the arguments for 'ISpPhrase.GetPhrase' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	18	At least one of the arguments for 'ISpPhrase.GetSerializedPhrase' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	31	At least one of the arguments for 'ISpPhraseAlt.GetPhrase' 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 'ISpPhraseAlt.GetSerializedPhrase' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	15	At least one of the arguments for 'ISpRecoContext.GetAudioOptions' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	16	At least one of the arguments for 'ISpRecognizer.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	55	At least one of the arguments for 'ISpRecoGrammar2.GetRules' 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 'ISpRecoResult.GetPhrase' 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 'ISpRecoResult.GetSerializedPhrase' 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 'ISpRecoResult.Serialize' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	35	At least one of the arguments for 'ISpSerializeState.GetSerializedState' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	13	At least one of the arguments for 'ISpStream.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	3	At least one of the arguments for 'ISpStreamFormat.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	2	At least one of the arguments for 'ISpStreamFormatConverter.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	52	At least one of the arguments for 'ISpXMLRecoResult.GetPhrase' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	53	At least one of the arguments for 'ISpXMLRecoResult.GetSerializedPhrase' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	54	At least one of the arguments for 'ISpXMLRecoResult.Serialize' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	49	At least one of the arguments for 'SpCustomStream.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	50	At least one of the arguments for 'SpFileStream.GetFormat' 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 'SpInProcRecoContext.GetAudioOptions' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	33	At least one of the arguments for 'SpInprocRecognizer.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	34	At least one of the arguments for 'SpInprocRecognizer.GetSerializedState' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	51	At least one of the arguments for 'SpMemoryStream.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	5	At least one of the arguments for 'SpMMAudioIn.GetDefaultFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	4	At least one of the arguments for 'SpMMAudioIn.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	11	At least one of the arguments for 'SpMMAudioOut.GetDefaultFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	10	At least one of the arguments for 'SpMMAudioOut.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	14	At least one of the arguments for 'SpSharedRecoContext.GetAudioOptions' 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 'SpSharedRecognizer.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	37	At least one of the arguments for 'SpSharedRecognizer.GetSerializedState' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	12	At least one of the arguments for 'SpStream.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	1	At least one of the arguments for 'SpStreamFormatConverter.GetFormat' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning	20	The type library importer could not convert the signature for the member 'SPPHRASE.pElements'.
Warning	19	The type library importer could not convert the signature for the member 'SPPHRASE.pProperties'.
Warning	21	The type library importer could not convert the signature for the member 'SPPHRASE.pReplacements'.
Warning	22	The type library importer could not convert the signature for the member 'SPPHRASE.pSREnginePrivateData'.
Warning	27	The type library importer could not convert the signature for the member 'SPPHRASEELEMENT.pszPronunciation'.
Warning	26	The type library importer could not convert the signature for the member 'SPPHRASEPROPERTY.pFirstChild'.
Warning	25	The type library importer could not convert the signature for the member 'SPPHRASEPROPERTY.pNextSibling'.
Warning	24	The type library importer could not convert the signature for the member 'SPPHRASERULE.pFirstChild'.
Warning	23	The type library importer could not convert the signature for the member 'SPPHRASERULE.pNextSibling'.
Warning	47	The type library importer could not convert the signature for the member 'SPSHORTCUTPAIR.pNextSHORTCUTPAIR'.
Warning	46	The type library importer could not convert the signature for the member 'SPSHORTCUTPAIRLIST.pFirstShortcutPair'.
Warning	45	The type library importer could not convert the signature for the member 'SPSHORTCUTPAIRLIST.pvBuffer'.
Warning	44	The type library importer could not convert the signature for the member 'SPWORD.pFirstWordPronunciation'.
Warning	43	The type library importer could not convert the signature for the member 'SPWORD.pNextWord'.
Warning	42	The type library importer could not convert the signature for the member 'SPWORDLIST.pFirstWord'.
Warning	41	The type library importer could not convert the signature for the member 'SPWORDLIST.pvBuffer'.
Warning	40	The type library importer could not convert the signature for the member 'SPWORDPRONUNCIATION.pNextWordPronunciation'.
Warning	39	The type library importer could not convert the signature for the member 'SPWORDPRONUNCIATIONLIST.pFirstWordPronunciation'.
Warning	38	The type library importer could not convert the signature for the member 'SPWORDPRONUNCIATIONLIST.pvBuffer'.

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 24839586
You should be able to double-click on each individual warning (or error) and be taken to the offending place in code. It sounds like you are trying to interface with something which is not in managed memory (active-x, COM, etc.). Because memory handling works a little differently in a managed environment, when you go to unmanaged, you have to convert the memory into a usable format for the unmanaged environment; hence, marshalling. You are getting warnings because the runtime cannot find a class that will implicitly convert those classes to an unmanaged form. Your code may work as is, but it also may not. Your errors are informing you that you may need to do some C/C++ style pointer manipulation (which is possible through use of the "unsafe" keyword and enabling of unsafe code in project properties) in order to use your object.
0
 

Author Comment

by:amillyard
ID: 24839702
"You should be able to double-click on each individual warning (or error) and be taken to the offending place in code. "

Exactly -- that's what I thought and hoping for (that process works where there is a line number indicated -- all these errors have no line number) -- when double clicking nothing happens.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24839749
Did you add a reference to a COM (or native) dll? VS might be having problems trying to resolve line numbers due to the unmanaged memory accesses.
0
 

Author Comment

by:amillyard
ID: 24839750
Confirming the code does compile and run fine -- just getting the 'warning' messages.  Wanted to try and clear all 'warning' message where possible.
0
 

Author Comment

by:amillyard
ID: 24839803
yes, these are the .dll's and .com's in the reference section (as attached).
VS-references.png
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

690 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