|
Hi,
Has anybody had any luck using the Microsoft SQLServer ODBC drivers (Driver version: 03.81.9030, ODBC version : 03.52)
to connect to a SQL Server 2000 database and passing in a SELECT with a FOR XML clause. I keep
getting Error [Microsoft][ODBC SQL Server Driver][SQL Server]The FOR XML clause is not allowed in a CURSOR statement
., State: 42000, Error: 6819.
Is there a work around (eg putting the select in a stored procedure) or am I missing something ?
I am using SQLExecDirect() to execute the statement.
Or could any one suggest a better way to retrieve data from a standard table in XML formated string?
Please Help!!
|
|
|
|
|
I have write a exe com server. It can run more than one instance. When my client exe call createinstance, it always connect to the first started one, but i want my client exe to popup a dialog to choose one to connect. Is Any body konw how to it? thanks!
c++ : my dream
|
|
|
|
|
When you do a create instance you specify the CLSID of your server which is unique and hence you are getting connected to the the first instance. Personally I think your EXE being an Out Of Process COM Server should be single instance and support MTA. Please, Correct me if I am wrong.
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Right it is out of process, but it is not single instance. The server is started first and can run serveral instance, which one is for a purpose.
c++ : my dream
|
|
|
|
|
Hello Richard,
I believe that in general, it is not possible to control the actual instance of your COM exe server from which to create your COM object.
This remains the privilege of the COM system. One thing that -is- controllable, however, is whether a new instance of your COM exe server is launched whenever a new instance of your COM object is created. Visual Basic allows for setting this.
I think that at runtime, the COM system refers to some value in the registry to determine whether a new instance of your COM server is to be launched. I really do not know what is the registry key to refer. I'll let you know once I find this out.
Hope the above helps, Richard.
Regards,
Bio.
|
|
|
|
|
I think you're seeing the situation the wrong way.
Your COM server should be Unique but think of it as the entry point for what you really need to be in multiple instances.
For example, see it as getting the handle of an Excel Application object, then you would want your client app to be able to select or create a new Excel Workbook.
So, Basicly, Client App gets a Handle to the COM server primary object which might contain a collection of SomeAppInstance that your client application can present to the user. The user is presented with 3 choices, 1) Select an instance, 2) Create a new instance, 3) Cancel Selection/Connection.
Hope this applies to your needs.
|
|
|
|
|
Hi all,
I'm trying to save a email message using MAPI. I can get to the message I want to save, but I'm not sure on how to save it to my hard drive. I'm using Outlook 2003 on XP Pro.
Thanks in advance.
Ken
|
|
|
|
|
How to get message string for HRESULTs I got from URLDownloadToFile() and other URL Monikers functions?
8 is error
C is FACILITY_INTERNET
5 is some error code.
I need smth like FormatMessage() API.
I tried FormatMessage() from modules "wininet.dll" and "urlmon.dll" (for codes 0x800C0005 and 5) but that does not work:
// hr == 0x800C0005
FormatMessage (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
GetModuleHandle("wininet.dll"), hr & 0xFFFF, 0, (LPTSTR) &msg, 0, NULL);
InternetGetLastResponse() does not return anything too.
BTW, I found the following explanations is MSDN:
The server or proxy was not found (Error=800C0005)
The protocol is not known and no pluggable protocols have been entered that match. (Error=800C000D)
What are other codes (I experienced 0x800C0007, 0x800C0008)?
|
|
|
|
|
BTW2, using IErrorInfo with GetErrorInfo() COM function does not return any error too.
|
|
|
|
|
Don't know how to translate automatically to strings, but for the URLMon error messages, you can look into the UrlMon.h header (in Platform SDK), where the codes are somehow described
e.g.
0x800C0005L - INET_E_RESOURCE_NOT_FOUND
0x800C0007L - INET_E_DATA_NOT_AVAILABLE
0x800C0008L - INET_E_DOWNLOAD_FAILURE
...
for detailed description you can then search for the descriptive code in MSDN (or google)
|
|
|
|
|
hi to every one hope every one ll b fine and enjoying the real world of
prog
i m looking for any one who can help me regarding to com i want to give
visual
look n feel to my control using ICON .ico the only thing i know about
that is using IPicture interface but how i dont know so help me i m
v.gr8 n pesonaly thankful to u
looking for ur coperation
regards
sommerbwn
sommerbwn
|
|
|
|
|
the IPicture interface and the methods OleLoadPicture are quite good described in the MSDN documentation :P
|
|
|
|
|
there is very god example in msdn over IPicture Interface,
search for LOadPic.exe in MSDN
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
I have written an outlook addin which retrieves the recipeint exchange address intead og SMTP mail id. Pls. can u help me get the SMTP address using vc++. Pls help with some sample code.
Thanks and regards,
Sujatha Raj
Sujatha.raj@india.rsystems.com
|
|
|
|
|
I have declared a linked list(requirement is like that) which contains another list. Now i wanted to pass that linked across DCOM. For communication i am using connection point. Please help me out in this or provide any alternate solution.
|
|
|
|
|
Hi
That is not possible, you can only pass arrays or more simpler types through DCOM. Please read MSDN about 'IDL', or a good COM book.
see ya kurt
Fast Prototyping
|
|
|
|
|
Plz anybody can tell me how to fire an event from within a thread since the threads method is static.
AKshay(CMMSoft)
|
|
|
|
|
Pass a pointer to the event's target to the thread function.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I don't undersatnd.Plz tell me in more detail.
|
|
|
|
|
Hello Akshay,
Event firing in a COM server is a very tricky process. This is especially true if your COM server is based on the apartment-threaded-model.
You must be able to obtain the event handling functions of your object's client application. This can be a complicated process involving going through the connection point clients of your COM object. From there, you can obtain the event handling functions of your Com object's events. Firing an event is simply invoking these event handling functions (of your client).
If you are using the apartment-threaded-model, you also will not be able to fire these events directly from within your thread. These event handling functions must be marshalled to your thread.
I really do not wish to disappoint you, Akshay, but event firing from within a thread (separate from the thread in which your COM object is created) is simply -NOT- a trivail or simple task.
I hope to write an article on this topic in the near future. I'll keep you posted on this. Meantime, I'll try to search for some good book references that can help you along.
Best Regards,
Bio.
|
|
|
|
|
Hi, I just need to fire a single event.Plz tell me how to do it in case of single threaded model.
|
|
|
|
|
Hello Akshay,
I'm preparing to write an article on event firing and event handling in threads. Please be patient with me on this However, for now, I -can- recommend to you some pointers and a reference to a good book on this subject.
The book's name is :
The Essense of COM with ActiveX (A Programmer's Workbook).
The author is David S. Platt.
Get a latest edition of this book. It is excellent. It presents COM subjects as a series of tutorials which are simple to follow.
Some pointers on event firing :
1. Events are essentially "outgoing" interfaces. They are methods of an interface which is not implemented by the COM Object itself but rather, by the -client- of the COM Object.
2. COM Objects which implement events must expose 2 additional interfaces from their COM object :
2.1 Connection Point Container.
2.2 Connection Point.
Please read up more on this in MSDN or in David Platt's book.
3. If you intend to fire your events inside a separate thread, you must marshall your client's event handler functions to this separate thread.
Hope the above helps, Akshay,
Bio.
|
|
|
|
|
Hello all,
I am working on an editor that automatically applies some formatting as the user types. Among these operations are syntax highlighting and character string insertions. I am currently using the ITextRange interface to apply syntax highlighting since it has been suggested elsewhere that this is the key to maintaining undo/redo ability in this context. Unfortunately I am not having any luck preserving the undo buffer in any useful state! Does anyone have any experience with this? Is it a matter of grouping operations with the (TextDoc) Begin/EndEditCollection functions? So far they have not yielded their secrets to me either
Any advice would be greatly appreciated!
Thanks,
Jon
|
|
|
|
|
In a vc++ project, I have a dialog box with a grid (m_flexGrid) and a
remote data control (m_rdc). In OnInitDialog, I set up m_rdc and then
try to set it to m_flexGrid with:
<br />
LPUNKNOWN rdcunk = m_rdc.GetControlUnknown();<br />
LPDISPATCH rdcdisp = NULL;<br />
HRESULT hr;<br />
hr = rdcunk->QueryInterface(IID_IDispatch, (void**)&rdcdisp);<br />
if (SUCCEEDED(hr)) {<br />
m_flexGrid.put_DataSource(rdcdisp);<br />
<br />
... ...<br />
<br />
}<br />
The put_DataSource give me a "Type mismatch" error. If I set up the
datasource property for grid in design time, everything works just fine.
Any suggestions?
|
|
|
|
|
how to write code using vb 6.0 to bar code reader from serial port?
|
|
|
|