473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Smart Pointers (SQLDMO): Acquiring SQLServer2 interface from SQLServer interface?

My C++ .Net project currently uses smart points for SQLDMO object
manipulation:

SQLDMO::_SQLServerPtr spSQLServer;
HRESULT hr = spSQLServer.CreateInstance(__uuidof(SQLDMO::SQLSer ver));
if (FAILED(hr))
{
return;
}

Is there a way I can acquire the SQLServer2 interface from the spSQLServer
object, instead of having to go through the CreateInstance procedure for
SQLServer2?

Given the following declaration, can someone describe how this could be
done?

SQLDMO::_SQLServer2Ptr spSQLServer2;

Thanks!

Dec 22 '05 #1
1 1834
Hi Mark,

After checked the SQLDMO.DLL's type library, we found the _SQLServer2 and
_SQLServer are just 2 different dispatch interfaces to the SQLServer
component:

[
uuid(10020200-E260-11CF-AE68-00AA004A34D5),
version(8.5),
helpstring("SQLDMO Server"),
helpcontext(0x00000258)
]
coclass SQLServer {
[default] interface _SQLServer;
interface _SQLServer2;
[default, source] interface ServerSink;
};

But for the reason that one COM component could only expose one dispatch
interface(e.g. for SQLServer, it expose the interface _SQLServer), so it is
impossible to acquire the SQLServer2 interface from the SQLServer component
whose default dispatch interface is _SQLServer.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: David B. Held | last post by:
I wanted to post this proposal on c.l.c++.m, but my news server apparently does not support that group any more. I propose a new class of exception safety known as the "smart guarantee". ...
2
by: ewm | last post by:
Using InstallShield Developer 7.04. Does anyone know of a good way to detect if SQLDMO is installed? TIA mcpoo
2
by: mgorman | last post by:
I have code that instantiates a sqlserver object and starts a job. I have used this on numerous XP workstations successfully, when I tried to move this to a Windows 2000 Application Server...
3
by: Verve | last post by:
Hi, how to create an SQL DMO object in .net and use it to enumerate the properties of Sql server. Can we use this object to list properties without logging in to the server?
1
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
3
by: T. | last post by:
I dumped VB and adopted C# for this version of Visual Studio. My problem! I am trying to reference an SQLDMO.Database object in C# like so: private SQLDMO.Database dbcurrent; private string...
6
by: Henry Padilla | last post by:
I am trying to use SQLDMO in C# and it's a nightmare. Any examples, suggestions, is there a different (managed) way to do this that I don't know about? Thanks for the help. Tom Padilla
3
by: Zack Sessions | last post by:
I am using VB.NET 2003. I found the following sample code here in an article: Dim oSQLServerDMOApp As New SQLDMO.Application Dim i As Integer Dim namX As SQLDMO.NameList namX =...
2
by: Alex | last post by:
Hi, I am new to the mysteries of SQLDMO. I have written a program whereby the user can select which SQL server to connect to on the Network and this works fine. I am using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.