Microsoft visualstudio data interop




















Look for parameters that are defined as an [out] data type int , object , and so on in the COM interface, but that are defined as arrays of the same data type in the Visual Studio interop assembly method prototype. If an object is not required, these COM interfaces return a null pointer as the value of that parameter instead of creating the [out] object.

This is by design. For these interfaces, null pointers are assumed as part of the correct behavior of the VSPackage, and no error is returned. Because the CLR does not allow the value of an [out] parameter to be null , part of the designed behavior of these interfaces is not directly available within managed code. The Visual Studio interop assembly methods for affected interfaces work around the issue by defining the relevant parameters as arrays because the CLR allows the passing of null arrays.

Managed implementations of these methods should put a null array into the parameter when there is nothing to be returned. Otherwise, create a one-element array of the correct type and put the return value in the array. Managed methods that receive information from interfaces with optional [out] parameters receive the parameter as an array. Just examine the value of the first element of the array. If it is not null , treat the first element as if it were the original parameter.

Look for parameters that are defined as [in] pointers in the COM interface, but that are defined as a IntPtr type in the Visual Studio interop assembly method prototype. A similar issue occurs when a COM interface passes a special value, such as 0, -1, or -2, instead of an object pointer.

Instead, the Visual Studio interop assembly defines the parameter as a IntPtr type. Managed methods that receive IntPtr parameters of this type should use the IntPtr type conversion operators to handle the results. First convert the IntPtr to int and test it against relevant integer constants. If no values match, convert it to an object of the required type and continue.

Look for methods that have a retval return value in the COM interface, but that have an int return value and an additional [out] array parameter in the Visual Studio interop assembly method prototype. It should be clear that these methods require special handling because the Visual Studio interop assembly method prototypes have one more parameter than the COM interface methods.

Instead of using a return value, the corresponding Visual Studio interop assembly methods send the information back to the calling program stored in an [out] array parameter. Managed implementations of these methods should create a single-element array of the same type as the [out] parameter and put it in the parameter.

The value of the array element should be the same as the appropriate COM retval. Managed methods that call interfaces of this type should pull the first element out of the [out] array. This element can be treated as if it were a retval return value from the corresponding COM interface. Skip to main content. This browser is no longer supported.

Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search.

I'm using VS to develop an app. Now, whenever I connect to database in Server Explorer, it shows me the report. It is the services missing error. It may be solved. If All those points above not worked NET Framework or install. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?

Collectives on Stack Overflow. Learn more. The Microsoft. Asked 12 years, 6 months ago. Active 5 years, 2 months ago. Viewed 2k times. IVsDataProviderManager service could not be found. Improve this question. Vicheanak Vicheanak 5, 15 15 gold badges 60 60 silver badges 96 96 bronze badges. Add a comment. Active Oldest Votes.



0コメント

  • 1000 / 1000