|
Why r u not trying to search on Google..
its very best option to search..
shailesh
|
|
|
|
|
Dear all :
I wrote an ActiveX embedded in my web page.
The purpose of this ActiveX is to play Music Video with subtitles.
It will download a file contains informations of subtitle
from internet dynamically.
I want users can select songs they want to play in
web page, and I can use javaScript to write the
play list information to cookie,then the ActiveX
can read the play list from cookie and play it!
My question is how does this ActiveX read and write(delete) cookies .
Can or Can't ?
Thanks a lot !!
Martin Jiang
|
|
|
|
|
I am learning a COM.
I have read COM is nothing but the QueryInterface...
but there is so much importance to HRESULT,GUID and Registry also...
So what does mean about COM..
On which actually COM focusses more???
How to know more about COM
shailesh
|
|
|
|
|
Shaileshvb wrote: I have read COM is nothing but the QueryInterface...
QueryInterface is important in COM, but it is not all there is to it.
Shaileshvb wrote: but there is so much importance to HRESULT,GUID and Registry also...
So what does mean about COM..
HRESULT is a standard return code in COM, and is fairly complicated. GUID means Globally Unique Identifier, which is used to identify interfaces, classes, and other items. QueryInterface takes a GUID as a parameter. Both of these are important.
Shaileshvb wrote: On which actually COM focusses more???
How to know more about COM
COM involves lots of issues, and which ones you need to learn about depend on what you are trying to do with it. I learned most of mine by reading MSDN library. While I usually had it installed on my computer, you can access MSDN library on the web at http://msdn.microsoft.com/[^]
Nathan
|
|
|
|
|
Hi,
Thanks Nathan.
I have going through the Book Gale Rogerson(Inside COM).It is fantastic..but for more details
can u suggest some more books...for more codes....help me out since I am totally new to COM...
shailesh
|
|
|
|
|
Shaileshvb wrote: have going through the Book Gale Rogerson(Inside COM).
Since you have completed Inside COM, you can read Essential COM by Don Box which covers some advanced topics.
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Shaileshvb wrote: can u suggest some more books...for more codes....help me out since I am totally new to COM...
I'm afraid not, since I didn't learn it from actual books. About all I can recomend is the MSDN library.
Nathan
|
|
|
|
|
hi shailesh,
there is book called inside COM by dale rogerson.
it's a good book for COM learner
all the best
|
|
|
|
|
Hi
can anyone help me finding a book about developing "com add-in" for office applications using mfc ?
thanks alot
Tarek
|
|
|
|
|
This is what I'm trying to do. I'm trying to write a DLL that will give me access to COM components that are available from an Off-The-Shelf product (Sherlock32) so I can get information from it while it is running. I've seen a lot of examples of how to write stand-alone code but I'm lost as to how to handle everything properly.
Now if I understand things I can use:
#import "c:\sherlock\bin\sp32.exe" named_guids no_namespace
in my header file to get access to the CSLID (CSLID_Sherlock) which was put in the exe.
Then I can use the following code to get access to the various features.
ISherlockPtr m_Sherlock;
CoInitialize(NULL);
m_Sherlock->CreateInstance(CSLID_Sherlock);
m_Sherlock->function;
CoUnitialize();
I'm I at least headed in the correct direction? I know I need to add some error checking to make sure the instance was created and the function is returning the correct stuff. One big question I have is should I create the instance once and hold on to it for the length of the use of the DLL or should I create and release it every time I want access to the functions?
[Side note: For those of you that are thinking why don't I just put my access code in the program that needs access to Sherlock here is the reason. The DLL is going to be used by a scripting program/language that has DLL capabilities but not COM.]
Thanks,
George
-- modified at 8:54 Friday 5th October, 2007
|
|
|
|
|
I had to google Sherlock32 to get an idea of what it was. You provide very little useful information.
But, if the executable or DLL that you are interested in is written in a way that it can act as a server for a COM class (this is not a requirement), it has to register its CLSID. Read this: COM Class Objects and CLSIDs[^]
The simplest approach is to call: CoCreateInstance[^]
Are you doing this in .NET? You gave no clue.
-- modified at 19:31 Thursday 4th October, 2007
|
|
|
|
|
Sorry for the lack of information but I was just trying to get a feel for whether my approach is correct and didn't realize you needed more information about Sherlock32. From what I understand about it it does run as a COM server and it has some functions available under its COMM server that should allow me to control it and get information from it. I'll take a look at the things you suggested.
I'm using Visual Studio C++ 6.0 to write my code and sticking with C++ & MFC for my coding. They haven't converted over to using .NET at my office yet.
Thanks,
George
|
|
|
|
|
Who know what the meaning of error code 269 ? I can't find it anywhere.
|
|
|
|
|
Hello,
Error 269 means that ReferenceBind is invalid. Reference name is missing.
I hope this helps.
Have a nice day.
Regards,
James Smith
James Smith
www.componentone.com
|
|
|
|
|
In which scenerios We can use Windows Service.
Can any body expling what is the purpose of windows services.
As windows service is continious running process.
Can we built windows service with out timer control? If Yes then please give a sample how.
Thanks in Advance
Chandra.Anumakonda
|
|
|
|
|
is a driver (sys file) a com program?
Zo.Naderi-Iran
|
|
|
|
|
I suppose it is possible, but that would be ridiculous for a device driver.
Most drivers are written in C or assembly. Typically, drivers are linked together in an operational stack, that is not COM-derived or dependent on the COM library. See the MSDN Kernel Architecture Design Reference[^] to get an idea of what types of system structures are required for Drivers. Its an entirely different world.
Programmers have been known to write kernel drivers to gain access to kernel mode data structures, as this is the only way to add user code to the operating system.
-- modified at 18:40 Thursday 4th October, 2007
|
|
|
|
|
Hi,
I have Simple ActiveX dll for opening connection to the database
and execute a stored procedure which returns a RecordSet.
I added it to the Component Services as a COM component
I spawned 10 threads to create object for COM and called the
method defined in the COM dll in Serialized Transaction support
and in ReadCommitted support.
I didnt notice any diffence in the execution time of the stored
procedure in both the cases.
What may be the reason?
With Thanks
Sakthi
|
|
|
|
|
Hi All:
I was trying to Used Distributed Transaction with Thread to allow many
Inserting operations into Different Databases in Different Server at the same
time
My Question is can we applying the Distributed Transaction and Threading
Together.
I try to apply it But the folowing Problem appeares through Open the first
Database Connection
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in mscorlib.dll
Additional information: The component is configured to use synchronization
and this method call would cause a deadlock to occur.
' Some oF My The Code
Private strDBQA As String = "Data Source=QASRV; Initial Catalog=employee;
Password=sasa; User ID=sa"
Private strDBFA As String = "Data Source=FADI; Initial Catalog=Employee;
Password=sasa; User ID=sa" 'Enlist =false"
Private _Itransaction As System.EnterpriseServices.ITransaction
Private _boolQ As Boolean = False
Private _boolF As Boolean = False
Public ReadOnly Property PITransaction()
Get
Return _Itransaction
End Get
End Property
'The Main Function
Function TestThread(ByRef strError As String)
Try
_Itransaction = System.EnterpriseServices.ContextUtil.Transaction
Dim objThread As System.Threading.Thread
objThread = New System.Threading.Thread(AddressOf QServer)
objThread.Start()
objThread = New System.Threading.Thread(AddressOf Fserver)
objThread.Start()
If _boolF = True AndAlso _boolQ = True Then
ContextUtil.SetComplete()
strError = "Completed"
End If
Catch ex As Exception
ContextUtil.SetAbort()
strError = ex.Message
Catch ex As Exception
End Try
Private Sub QServer()
Try
Dim oConnectionQ As New SqlClient.SqlConnection
Dim cmdSql As New SqlClient.SqlCommand
oConnectionQ .ConnectionString = strDBQA
oConnectionQ .Open()
oConnectionQ .EnlistDistributedTransaction(PITransaction)
cmdSql.Connection = oConnectionQ
cmdSql.CommandText = "update Test set ID = ID + 10"
cmdSql.ExecuteNonQuery()
_boolQ = True
If _boolF = True AndAlso _boolQ = True Then
ContextUtil.SetComplete()
End If
Catch ex As Exception
ContextUtil.SetAbort()
End Try
End Sub
Private Sub Fserver()
Try
Dim oConnectionF As New SqlClient.SqlConnection
Dim cmdSql2 As New SqlClient.SqlCommand
oConnectionF .ConnectionString = strDBFA
'================
' in the strF oPen The Error Appear
oConnectionF .Open()
oConnectionF .EnlistDistributedTransaction(PITransaction)
cmdSql2.Connection = oConnectionF
cmdSql2.CommandText = "update Test set ID = ID + 10"
cmdSql2.ExecuteNonQuery()
_boolF = True
If _boolF = True AndAlso _boolQ = True Then
ContextUtil.SetComplete()
End If
Catch ex As Exception
ContextUtil.SetAbort()
End Try
End Sub
F.mathkour
|
|
|
|
|
|
Can i save array of int values into attribute using put_value method????
Because i have some problem with this. It save only first element of array.
Maybe i have some error in my code,
int *arr = new int[ 5 ];
for( int i = 0 ; i < 5 ; i++ )
arr[ i ] = i;
VARIANT var;
var.vt = VT_BYREF|VT_INT;
var.pintVal = &arr[0];
hr = spXMLDOMAttribute->put_value( var );
|
|
|
|
|
vippavlo wrote: Can i save array of int values into attribute using put_value method????
Because i have some problem with this. It save only first element of array.
Maybe i have some error in my code,
int *arr = new int[ 5 ];
for( int i = 0 ; i < 5 ; i++ )
arr[ i ] = i;
VARIANT var;
var.vt = VT_BYREF|VT_INT;
var.pintVal = &arr[0];
hr = spXMLDOMAttribute->put_value( var );
I don't think you can just save an array to an attribute, but I do know that VT_BYREF doesn't make it an array. If this were to work at all, you would have to create a SAFEARRAY and make a variant of type VT_ARRAY | VT_INT
Nathan
|
|
|
|
|
Thanks for answer))) i found some info about this and now i know that i should be use SAFEARRAY.))
Sory for some grammar mistakes. I'm from Ukraine and don't know Enlish perfect
-- modified at 18:09 Monday 24th September, 2007
ISQ 469907496
|
|
|
|
|
Do you know exactly that SAFEARRAY will be stored correct in attribute???
Because i have a problem when i put value into attribute: "Type mismatch". What it mean??? May be i create SAFEARRAY uncorrect???? If you have some example for putting CComSafeArray into CComVariant, please give me, i'll be much obliged to you.
ISQ 469907496
|
|
|
|
|
vippavlo wrote: Do you know exactly that SAFEARRAY will be stored correct in attribute???
Because i have a problem when i put value into attribute: "Type mismatch". What it mean??? May be i create SAFEARRAY uncorrect???? If you have some example for putting CComSafeArray into CComVariant, please give me, i'll be much obliged to you.
I believe I mentioned in my last reply that you probably can't store an array in an XML attribute. Type mismatch is the error I'd expect if it wasn't allowed. You can probably define your own method to convert the array to and from a string, since string is the real type of the attribute anyway. While I'd just drop SAFEARRAYs for what you are doing, I've found an example of creating a SAFEARRAY in the MSDN documentation:
SAFEARRAYBOUND sab;
sab.cElements = 2;
sab.lLbound = 0;
hresult hr;
SAFEARRAY * pSa;
pSa = SafeArrayCreateEx(VT_RECORD, 1, &sab, pRecInfo);
if (pSa == NULL)
return E_OUTOFMEMORY;
PVOID pvData;
hr = SafeArrayAccessData(pSa, &pvData);
if (FAILED(hr)) {
SafeArrayDestroy(pSa);
return hr;
}
TEST * pTest;
pTest = (TEST *)pvData;
pTest[0] = a;
pTest[1] = b;
hr = SafeArrayUnaccessData(pSa);
if (FAILED(hr)) {
SafeArrayDestroy(pSa);
return hr;
}
VariantInit(&variant);
V_VT(&variant) = VT_ARRAY|VT_RECORD;
V_ARRAY(&variant) = pSa;
This code uses basic COM functions instead of MFC, but CComVariant is designed to work with any function that takes a VARIANT. If you are using ATL, there is a CComSafeArray class that can simplify it some more.
Nathan
|
|
|
|