|
How to get the frame rate of a .wmv file while the IWMInfoHeader interface cannot get the related attributes? Thanks
|
|
|
|
|
During the work i have provided the task for Creating the
#1 evaluation version Component or ActiveX Dll
#2 Developer Version DLL
#3 Runtime DLL.
i have almost sorted out First task By producing a Modeless Atl dialog box .
but i still can't understand how to develop Developer DLL and Runtime Dll ,as i was told that you have to stop runtime dll to connect to IDEso that only application can use that.
can any body provide me any good pointer towards it.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok,
1. For the Runtime DLL, you need to stop the DLL from running under a debugger/IDE.
Have a look in the MSDN documentation for ::IsDebuggerPresent()
Also look at ::GetModuleFileName() - check the value that comes back and see if it corresponds to known debuggers/IDEs (eg "DEVENV", "MSDEV", "WinDBG") etc.
Of course, some sneaky people might rename MSDEV.EXE to something else. In this case you could go here[^] and grab the CVersionInfo class. Initialize it with the path returned from GetModuleFileName() and do the same check for known debuggers/IDEs using the value returned by CVersionInfo.GetInternalName(). Unless they go to the effort of changing the values in the Version Block, this will work.
You also want to see what the parent process is. Have a look at KB article 175030, which will show you how to do this. Again, once you have the name of the parent process you can do the debugger/IDE name check as above. This means that even if someone executes your DLL using Ctrl+F5 from Visual Studio (which "detaches" the executed program from the debugger) it will still trap them.
2. For the Developer DLL you don't need to do anything. I suppose if you *only* want it to run under a debugger/IDE, then you can just use step (1) and reverse all the logic
Of course none of this is foolproof, but it will slow people down. I've used these methods and they work well.
Hope this helps,
Gary
|
|
|
|
|
Thanks Sir.
Sir Garence wrote:
Of course none of this is foolproof, but it will slow people down. I've used these methods and they work well.
Atleast something is better then nothing
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi All,
In VC++ 6, I have created a simple COM component that contains a single method on a single interface that returns a 2 dimensional SafeArray (3 columsn, variable number of rows) wrapped by a VARIANT. I tested the component from a C++ test app and the data is returned in the Variant/SafeArray and can be extracted using conventional means, and all is well. This whole process took about 3 hours. I have spent the last 4 days trying to get the component to work when instantiated in ASP code (VBScript). Sorry for this long post but I want to include as much info as I can in hopes that some kind soul will help.
The component was created with a single control (Simple Object). The function looks like this...
STDMETHODIMP CSiteSearch::SearchHTM(BSTR searchPath, BSTR searchPhrase, VARIANT *pSearchResults)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
..................
Guts of function here to generate three CStringArrays (documentTypeArray,documentPathArray and documentContextArray) to be packed into the SafeArray and then wrapped by the Variant
..................
// Now stuff the safe array and return the data
DWORD numElements[2];
numElements[0] = 3;
numElements[1] = documentTypeArray.GetSize();
COleSafeArray sa;
sa.Create(VT_BSTR,2,numElements);
long elementIndex[2];
BSTR bData;
for (int row = 0; row < documentTypeArray.GetSize(); row++)
{
// Insert each column into the SafeArray
elementIndex[0] = 0;
elementIndex[1] = row;
bData = _bstr_t(documentTypeArray.GetAt(row));
sa.PutElement(elementIndex,bData);
elementIndex[0] = 1;
elementIndex[1] = row;
bData = _bstr_t(documentPathArray.GetAt(row));
sa.PutElement(elementIndex,bData);
elementIndex[0] = 2;
elementIndex[1] = row;
bData = _bstr_t(documentContextArray.GetAt(row));
sa.PutElement(elementIndex,bData);
}
// Return the array in a variant
CComVariant cVar;
cVar.Attach(pSearchResults);
cVar.Copy(sa);
cVar.Detach(pSearchResults);
}
return S_OK;
}
This works fine when called from a VC++ dialog based, client app (importing the type library).
The ASP/VBScript code that does not work looks like this...
' The creation of the control and the call of the method works without error
Set searchControl = Server.CreateObject("WebSiteSearch.SiteSearch.1")
theResults = searchControl.SearchHTM ( "C:\SomeFolderToSearch", searchPhrase )
' The following code does indeed identify the returned value (theResults) as an array... so, so far so good!
if (IsArray(theResults)) then
Response.Write("Its an Array")
else
Response.Write("Not an Array")
end if
' The following two lines return 0 and 2 respectively which is right, for one dimension of the array. The array should have 3 columns and a variable number of rows
Response.Write("Lower: " & LBound(theResults))
Response.Write("Upper: " & UBound(theResults))
' This fails!!!
Response.Write( theResults (0,0) )
' The error in the IIS 6.0 error log leads me to believe that VBScript does not recognize theResults as a two dimensional array (puzzling because the VC++ client does recognize the contents of the Variant as a two dimensional array) and is:
2004-11-03 15:21:17 GET /SearchResults.asp SearchFor=Code|25|800a000d|Type_mismatch:_'theResults' - 500 0
Any and all ideas would be GREATLY, GREATLY appreciated!
Thanks,
Doug
Doug Knudson
|
|
|
|
|
Your problem is the usage of BSTR value after the _bstr_t's destructor.
Change bData's type from BSTR to _bstr_t:
_bstr_t bData;<br />
...<br />
bData = documentTypeArray.GetAt(row);<br />
sa.PutElement(elementIndex,(BSTR) bData);
With best wishes,
Vita
|
|
|
|
|
Help! I first noticed that COM+ service is crashing when I tried to connect to my IIS that serves ASP (HTML works). After rebooting, restarting and so on I went into the "Components services" and when tried to open "computers" hoping to see "my computer" this control window dissapeared! Look in event log and again COM+ crashed.
Help! I need the IIS with ASP.
|
|
|
|
|
:Hi
i want to get the properties of activeX control running in other process one thing to remember they r not created by me but they r common activeX control like MSFlexGrid, MSCalender. I have got the HWND of the control but i basically need its pointer so that i can access its properties........ i m basically injecting code in that process for this purpose , the remote thread procedure does not work however i got some success through subclassing that is i changed the WndProc of the control then i was able to access the properties of activeX control of those applications that were build through MFC but when i checked it on applications build through VB it doesnot work hmmm one thing i forgot that DLL that i used for injecting my code was using MFC in shared Dll it was not working when it was statically build
here is the code that i was using for getting pointer to control:
::CoInitialize(NULL);
CWnd *c=CWnd::FromHandle(hwnd);
LPUNKNOWN pUnk =
c->GetControlUnknown();
LPDISPATCH pDisp = NULL;
if(pUnk!=NULL){
pUnk->QueryInterface(IID_IDispatch, (LPVOID*)&pDisp);
///some work with idispatch
}
::CoUninitialize();
|
|
|
|
|
Hi
I developed C# component , when I call that component in my VC.6 Code the CoCreateInstance is failing
hr = CoCreateInstance (theCLSID, NULL, CLSCTX_LOCAL_SERVER, IID_IUnknown, (void**)&pIUnk )
In the above case the CoCreateInstance is failing with the error value of -2147221164 ( Class not registered).
If I modified the code as
hr = CoCreateInstance (theCLSID, NULL, CLSCTX_ALL, IID_IUnknown, (void**)&pIUnk ) ;
everything works fine.Can any one tell why HRESILT is failing in the first case?
Thanks in Advance
kishnasarma
|
|
|
|
|
Is it a COM Exe or a DLL ??
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
|
How about trying individual CLSCTX -
1. CLSCTX_INPROC_HANDLER
2. CLSCTX_LOCAL_SERVER
3. CLSCTX_REMOTE_SERVER
so as to find what the problem is.
Also look in registry CLSID\yorserverid what Server key is created for the server you are using.
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
The major problem here is VC 6 Code is third party code and the vender is using the option CLSCTX_LOCAL_SERVER
|
|
|
|
|
i m developing a small telephony app usig TAPI. to intitialoze tapi i have to get ITTAPI ptr.
ITTAPI *gpTapi;
HRESULT res = CoInitialize(NULL);
CoCreateInstance(CLSID_TAPI,NULL,CLSCTX_INPROC_SERVER,IID_ITTAPI,(LPVOID *)&gpTapi);
gpTapi->Initialize();
i have added tapi3.h and also give link to Uuid.lib. At compile time it gives no error but at link time it gives error "unresolved symbol _CLSID_TAPI" and same error for "IID_ITTAPI". any one hav idea wats hapening. how can i find CLSID for TAPI and IID for ITTAPI. plz help
|
|
|
|
|
I Too have Face this type of problem many time.
but i get Successful evey time by applying little hack like
you are writing this way
MATRIX- wrote:
CoCreateInstance(CLSID_TAPI,NULL,CLSCTX_INPROC_SERVER,IID_ITTAPI,(LPVOID *)&gpTapi);
and i write this this way.
CoCreateInstance(__uuidof(TAPI),NULL,CLSCTX_INPROC_SERVER,__uuidof(ITTAPI),(LPVOID *)&gpTapi);
but using this hack my above code Run every time,gods Know why??
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
i am willing to build a very simple hex editor program but i dont know where to start so if anybody have any hints, tips or suggestions please let me know. cheers
|
|
|
|
|
CD_ROM wrote:
i am willing to build a very simple hex editor program but i dont know where to start so if anybody have any hints, tips or suggestions please let me know.
i don't know about how to build a HEX Editor but you can found a Example Sourcecode in System Section OF MFC/C++ of CP
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I am new to COM and I have a silly doubt.
GUID is the combination of network address, the time (in 100 nanosecond increments), and a counter.
Suppose if don't have a network address while creating the Class and I got an ID (Which may not be unique). And after that I connected to the network. What will be the impact of this on the one, which is having the same ID somewhere else?
|
|
|
|
|
Ranjish wrote:
Suppose if don't have a network address while creating the Class and I got an ID (Which may not be unique). And after that I connected to the network. What will be the impact of this on the one, which is having the same ID somewhere else?
suppose if you have read that book carefully it may have stated that when there in no network adapter,the chance of getting Unique Guid are NULL.
The Window Based GuidGen don't display error if it don't find the network card but if you go for dosbased UUIdgen,it willdisplay warning if it don't found the network card.
sorry for behaving rudly to u
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Dear Alok Gupta,
I agree with you, but there is a slight possiblity. I am asking if there is one what will be the impact.
|
|
|
|
|
Hi there!
i am Sorry
the new component when register it will overwrite previous value and application that using the previous value may get stop working.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok,
Thanks for your reply.
One more doubt. To make my old component work, will simple compilation work for for me.
|
|
|
|
|
Yeah Brother Ranjish,
i am too New at Com,but i know when ever you build a com dll it perform registration.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you very much dear Alok.
|
|
|
|
|
you are always welcome Ranjish
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|