|
hi!
ive got a problem developing an avi source filter!
the problem is that i need to read the file from disk while the file is playing in directshow! the other way is the example that shows directshow in its sample file source that comes with the sdk, but it is too slow, because it reads the full avi file in ram in the load function (from the ifilesourcefilter interface) before getting connected to the avi splitter and so on it wastes too much time! ive read that it is possible not to read the whole file and get connected succesfully to the avi splitter faking the contents of the memory buffer and reading from the file only the riff header, the avimainheader structure and the idx1 structure, but i dont know if its really true!if you please wonna confirm me the parts of the file and the structures to do it that are needed to make the avi splitter get connected i will apreciate it a lot, cause im getting frustrated with this and it doesnt go on!
thanks a lot!
villalvilla
|
|
|
|
|
Hi,
I have the following code in my DLL.
InnerClass* pInnerClass;
CComObject<cinnerclass>* pInnerC;
HRESULT hr = CComObject<cinnerclass>::CreateInstance(&pInnerC);
hr = pMyC->QueryInterface(IID_IInnerClass, reinterpret_cast
<<void**>>(&pInnerClass));
STDMETHODIMP CMyClass::get_InnerClass(IInnerClass **pVal)
{
if (pVal == NULL)
return E_POINTER;
*pVal = pInnerClass;
(*pVal)->AddRef();
return S_OK;
}
I have no problem with the code when I compile my code without Unicode, i.e. I have not problem running my DLL. But when I compile in Unicode mode, I always get the error:
Unhandled exception in Demo.exe(MyClass.DLL): 0xC0000005: Access Violation
After my debug, it seems that the line (*pVal)->AddRef(); is giving me the problem. But if the line is removed, I will have the same problem in all mode of compiling.
Please help me..
|
|
|
|
|
w_logan wrote:
(*pVal)->AddRef();
Please confirm that before the above selected code
pVal != NULL
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I need to copy data using com from one application to another.For example if card inserted in the card reader it takes the data from card and place it at the position of the cursor of the currently running application. My code to control card will be in c++ or java or vb but i want to use com to do data transfer like barcode reader driver does.
|
|
|
|
|
You can do it with SetWindowText API function. You should pass the handle of the edit you want to insert data.
It works fine!
You can also use SendMessage API.
If you have questions about using them, please ask.
|
|
|
|
|
Thanks but I don't know how to use both SetWindowText API and SendMessage API, I expect another help from you
|
|
|
|
|
Also I want to pass the handle of any edit which currently has focus.
|
|
|
|
|
Hi
Get the handle of the window that currently has focus, using GetForegroundWindow() API.
Then Find the Edit inside the window using FindWindowEx function. Which returns the window handle for the edit box.
After that, you set the text as follows:
SetWindowText(EditHandle, "ANYTHING YOU WHICH")
For help under any of these APIs please refere to MSDN.
|
|
|
|
|
Hi all,
I look for common class name for all editable control running on windows OS
|
|
|
|
|
Hi all
I am using WMI(Windows Management Instrumentation) to extract varios system information, here when it returns VT_NULL, and I try to assign this variant type variable to a structure then memory access violation error appears.
The code snippet is as follows:
IEnumWbemClassObject * pEnumObjectStorageDevice = NULL;
HRESULT hResStorageDevice;
BSTR strQueryStorageDevice = (L"Select * from Win32_LogicalDisk");
BSTR strQLStorageDevice = (L"WQL");
hResStorageDevice = pWbemServices->ExecQuery(strQLStorageDevice, strQueryStorageDevice,WBEM_FLAG_RETURN_IMMEDIATELY,NULL,&pEnumObjectStorageDevice);
if(hResStorageDevice != S_OK)
{
MessageBox("Could not execute Query");
return;
}
ULONG uCountStorageDevice = 20, uReturnedStorageDevice;
IWbemClassObject* pClassObjectStorageDevice;//[20]; // = NULL;
i=0;
while (pEnumObjectStorageDevice)
{
HRESULT hr = pEnumObjectStorageDevice->Next(WBEM_INFINITE, 1,&pClassObjectStorageDevice, &uReturnedStorageDevice);
int a = GetLastError( );
if(uReturnedStorageDevice == 0)
{
break;
}
VARIANT vStorageDeviceDriveLetter,vStorageDeviceDriveType,vFileSystem;
VARIANT vDriveSize,vFreeSpace;
BSTR strClassPropStorageDevice = SysAllocString(L"Caption");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, &vStorageDeviceDriveLetter, 0, 0);
strClassPropStorageDevice = SysAllocString(L"Description");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, &vStorageDeviceDriveType, 0, 0);
strClassPropStorageDevice = SysAllocString(L"FileSystem");
HRESULT hrFileSystem = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vFileSystem), 0, 0);
strClassPropStorageDevice = SysAllocString(L"Size");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vDriveSize), 0, 0);
strClassPropStorageDevice = SysAllocString(L"FreeSpace");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vFreeSpace), 0, 0);
StructStorageDeviceInfo[i].strDriveLetter = vStorageDeviceDriveLetter;
StructStorageDeviceInfo[i].strDriveType = vStorageDeviceDriveType;
StructStorageDeviceInfo[i].strDriveFileSystem = vFileSystem;
StructStorageDeviceInfo[i].strDriveSize = vDriveSize;
i++;
VariantClear(&vStorageDeviceDriveLetter);
VariantClear(&vStorageDeviceDriveType);
VariantClear(&vFileSystem);
VariantClear(&vDriveSize);
VariantClear(&vFreeSpace);
}
Here when this program enumerate A: and there is no disk in FDD, then in case of "File System, Drive Size & Free Space" it returns VT_NULL and in line
StructStorageDeviceInfo[i].strDriveFileSystem = vFileSystem;
Memory access violation error appears .
Please suggest me to overcomr this problem.
Thanks & Regards.
Edit/Delete Message
|
|
|
|
|
Rajiv,
In your structure member what is the type of strDriveFileSystem. And also it is not a good practise to assign a VARIANT structure data to the structure member..
1. First Clear the variant variable
2. if strDriveFileSystem is just a pointer to a char array, there should not be any access violation. I think strDriveFileSystem should a class variable which is trying to convert the variant value to a string thus a exception..
if the strDriveFileSystem is valid,
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Rajiv,
In your structure member what is the type of strDriveFileSystem. And also it is not a good practise to assign a VARIANT structure data to the structure member..
1. First Clear the variant variable
2. if strDriveFileSystem is just a pointer to a char array, there should not be any access violation. I think strDriveFileSystem should a class variable which is trying to convert the variant value to a string thus a exception..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hi there!
I have a component that registers an Event Sink i Exchange 2000. All was fine and dandy until I - for other reasons - had to reinstall my component.
Now when I try to register my Event Sink in the SystemMailBox through ADODB I get an "Access denied" error. I have already searched high and low on Google - but can only find other people with the same problem, but no solution.
The problem occurs when I set the field "DAV:contentclass" to "storeeventreg".
Does anybody have a solution to this problem ?
Best regards,
Michael B. Hansen
|
|
|
|
|
Hi!
i am facing problem with COM+ service to print doc when COM+ Service owner is not logged on the system.As this service uses user profile to load list of printers to select one that is specified in configuraion or any other.Problem is that if user profile is only available when user logs on to system.currently i am using a utility to restart com+ service after user logs on to get printer list.
Any solution to this issue.
Regards,
=-=-=-=-=-=-=-=-=-=
Anayet
=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
Hi,
Can someone tell me what is the difference between compiling in the following mode??
Win32 Release MinSize
Win32 Release MinDependency
Win32 Unicode Release MinSize
Win32 Unicode Release MinDependency
Thanks in advance
|
|
|
|
|
They are all different;
Win32 vs Win32 Unicode
The code is built with either _UNICODE and UNICODE defined (the latter), or not (the former), which generally means using wide versions of system APIs, etc, except where explicit calls are made. Unicode apps won't run on W9x/ME systems, unless you're also using the MSLU.
MinSize and Mindependency will also alter the way it's compiled. Mindependency means it relies on almost nothing else at install/runtime, so will often cause non-dll versions of libraries to be linked in, which may result in a larger app and a bigger footprint. Minsize does the reverse, and will use DLL versions of things like the CRT, which will give you a smaller app, and for apps that use DLL components which also use DLL versions of libraries, a smaller footprint. This is somewhat simplified.
Steve S
Developer for hire!
|
|
|
|
|
Thanks for the reply. One of the few good reply I had read.
There are too many replies in this forum that never asks the questions.
|
|
|
|
|
I am trying to get an array created in a COM Server and passed back to the client by the mechanism: [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords
from the .idl file.
Where the pNum_ROI_nodes is the size of the array and pROI_coords is the name of the array.
Problem: I am receiving only one value back in this array on the client side. I have verified that only one value is being allocated in the array by the marshaller in the client side. All data is being loaded into the server side of this array (where it is being created by (float*) CoTaskMemAlloc((resultNodes * 2) * sizeof(float))) The data on the client side is the very first value loaded into it by the server and nothing else except 0x0d f0 ad ba in the second location. (bad food)
Is there some setting for the COM that is confusing the marshaller? The above [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords is only in the *.idl file. Should it be somewhere else as well??
The marshaller just doesn't seem to be getting the idea that there is an array, rather a single value.
Thanks in advance,
David
|
|
|
|
|
The standard TypeLib marshaller knows nothing about [size_is] keyword for parameter and cannot be used here. Instead you should build the Proxy/Stub DLL and use it to marshal this interface.
With best wishes,
Vita
|
|
|
|
|
Thank you for your posting, but I need some more info on how to do what you suggested. Could you tell me some steps on how to do this and how is it different than what I have already done? I don't know the difference.
Regards,
David
|
|
|
|
|
Look at main cpp file. Here you can find the useful information. Something like that:
// XXXX.cpp : Implementation of WinMain or DLL Exports.
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f XXXXps.mk in the project directory.
With best wishes,
Vita
|
|
|
|
|
I tried to do that from a command prompt window, but got an error:
fatal error C1189: You need a Windows2000 or later to run this stub because it uses the following features: NMAKE: error U1077: 'cl' return code '0x2'. Stop.
Any ideas?
David
|
|
|
|
|
I don't know what should you do in this case. I didn't use the command prompt window.
1. You can create (and add to existing DSW) the new project which will produce the Proxy DLL. The type of this project is "Makefile" selected from all available projects.
2a. You can add the xxxps.mk file into "Source" files of your project and specify the "Custom Build" for this entry.
2b. You can specify the "Custom Build" (or "Post-biuld step") for your project entry to make and register the Proxy DLL.
IOW, let the VC IDE to run NMAKE into correct environment formed by IDE.
With best wishes,
Vita
|
|
|
|
|
Hi Vita,
I can see you are good with COM and C#. I am new to use c# and I did not use COM before. I would appreciate if you could help me.
I need to execute Cache methods from c# programm. Now Cache does not have yet any interface to c#, but there is COM for c++ 6.
Using this COM in c# I can open Cache DB, but I cannot (I do not know how) to access properties of the classes stored in Cache database.
I exported Cache classes in ODL format. Cache created this file that has uuid and id for every method I created in Cache. Now, my problem is how can I call these methods in C#? I would appreciate if you could refere where can I find any code how to call methods when I have them in odl file.
Thanks in advance,
RikaBoy
-- modified at 3:46 Saturday 27th August, 2005
|
|
|
|
|
|