HI, thanks for the reply, i put the memset in the constructor. i am guessing that it has something do to with different heap memory allocated for dll, and AP? --------------------------.cpp--------------------------------------------------- CIPCamDll::CIPCamDll() { memset(&m_t,0,sizeof(s)); session_id = 13; return; } ------------------------.cpp------------------------------------------
User 404410
Posts
-
problem in deleting dll class object.(scalar deleting destructor) -
problem in deleting dll class object.(scalar deleting destructor)HI, i am having problem with converting my c++ class to dll. The problem is the following. i have a class that i want to export, there are two private variables in the class, one of them is a struct. the variables are initialized in the constructor. In my ap, i created a object of my class and then delete it. Looks pretty straight forward, however, when deleting the object i get a error message "Debug Error". If i don't initialize the variables, delete is ok. if i memset the struct variable,i get a "scaler deleting destructor" error. Anyone got any idea why the dll behaves like this? ----------------------------------------AP------------------------------------ CIPCamDll *a = new CIPCamDll(); delete a; ---------------------------------------.h-------------------------------------- #ifdef IPCAMDLL_EXPORTS #define IPCAMDLL_API __declspec(dllexport) #else #define IPCAMDLL_API __declspec(dllimport) #endif typedef struct s { int abcd; }s; class IPCAMDLL_API CIPCamDll { public: CIPCamDll(void); CIPCamDll(char* para_address); ~CIPCamDll(void); private: int session_id; s m_t; }; -------------------------------------------------------------------------------- --------------------------.cpp--------------------------------------------------- CIPCamDll::CIPCamDll() { session_id = 13; return; } CIPCamDll::CIPCamDll(char* para_address) { return; } CIPCamDll::~CIPCamDll() { return; } ------------------------------------------------.cpp-------------------------------
-
CONVERT RGBX to RGBTRIPLEHI, I wrote a following code to retrive RGBX bits from a bitmap, but does anyone know how to retive RGBTRIPLE bits using GETDIBits? THanks BITMAPINFO bi; int height = Get_Bitmap_Info(bi); if (!height) return FALSE; BYTE* p_bits = (BYTE*)new BYTE[bi.bmiHeader.biSizeImage]; HDC hdc = GetDC(NULL); if (!GetDIBits(hdc, (HBITMAP)GetSafeHandle(), 0, height, p_bits, &bi, DIB_RGB_COLORS)) { delete p_bits; p_bits = NULL; } ::ReleaseDC(NULL, hdc); return (RGBX*)p_bits;
-
Direct Show Video WindowHi, the following code put set video window to g_hwnd handler.. if i want to return the handler to it's original stat how do i do that? IVideoWindow *pVidWin = NULL; pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin); pVidWin->put_Owner((OAHWND)g_hwnd); thanks
-
Active a event while in a while loop ??Hi, i am writing a program which produces a constant square wave form from Parallel port. I am doing this in a infinite while loop, the problem is i also want something to happen when i click a button on the dialog. How do i keep the loop runing and still be able to click a button? THANKS
-
Retriving System Device IconsHi, I am having problem retriving system device icons, i know there is a function in ddk that allows you to do just that, however i am not sure if i am using it correctly. Can anyone check what is wrong with the function below thanks... or can anyone suggest any other ways of retriving system device icons.. thanks.... int DeviceView::GetClassImage(HIMAGELIST& imagelist) { _SP_CLASSIMAGELIST_DATA *classlist = new _SP_CLASSIMAGELIST_DATA; classlist->cbSize = (BYTE)sizeof(PSP_CLASSIMAGELIST_DATA); if (!SetupDiGetClassImageList(classlist)) { return false; } imagelist = classlist->ImageList; delete classlist; return true; } :-D
-
Finding hardware Device Infomation...hi, does anyone know how to retirve information of a particular hardware device? eg. USB devices(pc Cam) thanks
-
Device Manager source codeHi, does anyone know where i can find a deivce manager like project? thanks
-
How do i pass data to a view from an independent class?Hi, does anyone know the proper way to pass data from one independent class to a view within SDI? thanks... :omg:
-
Passing data between a popup dialog and SDIHi, Does anyone know how do i pass data bettwen a popup dialog and single documnet interface with splitter window? In my mainframe of SDI i wrote TestDlg* dlg = new TestDlg; dlg->DoModal(); From SDI how do i retrive data from the dialog box? Thanks
-
How do i make a pop up window in CFormView within SDI?As title Thanks
-
Create Process + WaitForSingleObject hangsHi, I have a problem with WaitForSingleObject. my code are as follows int RunExternalProES(LPTSTR ExecProc, int option) { STARTUPINFO si; PROCESS_INFORMATION pi; DWORD pProcessID; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess(NULL, // No module name (use command line). ExecProc, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. TRUE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { return FALSE; //( "CreateProcess failed." ); } if (option == 1) { WaitForSingleObject(pi.hProcess, INFINITE); } } i found that sometime waitforsingleobject function will hang for some process.. is there any reson why this happens? Thanks
-
How do i register a COM object (Direct X filter) from a applicatoin program?Hi, Does anyone knows how to register a DirectX filter (*.ax) from a application program without using Regsrv32 xxx.ax? ;P
-
How do i Monitor a external program statusHi, i have several program that execute one after another using the following fuction. However, one of the program hide it's window b4 it finishes its process, so there is a big time delay b4 the next process begins.. how do i actually detect if a process calls a hid window command? CreateProcess. WaitForSingleObject( pi.hProcess, INFINITE ) Thanks
-
Auto Device Driver Installation..Hi.. Just wondering if there is a installation software like installshield which can automatically install an device driver(with inf file). i have written a program which calls an SetupCopyOEMInf function from DDK. It works fine with win2000 and winxp but not with win98 and me.. thanks...
-
DirectShow ...How do i overlay a bitmap pic over a video source?Hi,, Just wondering if anyone knows how do i overlay a bitmap or draw a frame onto a video source... I've created a Histogram filter, which inherites from CTransform filter. HRESULT CHistogram::Transform(IMediaSample *pIn, IMediaSample *pOut)
-
How do i switch between two DialogsHi, just wondering how do i switch between two dialog.. what i means is when i switch to another dialog i want hide the current one and vice versa.. THANKS
-
how do i Detect if an external program has finished excuting(shellexec)?I want to execute several external programs in a que. I have to execute one program and wait for it to finish and excute another. Is there a way to detect if a external running program has finished? Thanks
-
DirectShow 8.1 .. Problem Connecting two filters.I am trying to connect 3 filter together.. pSrc is my souce capture device filter.. it is connected to a smartTee filter through RenderStream method,(this part works ok). However, when i tried to connect the preview pin from smartTee filter to the input of my VideoRender filter it doesn't work.. can someone see where the problem is? CoCreateInstance(CLSID_SmartTee, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&smartTee); CoCreateInstance(CLSID_VideoRenderer,NULL, CLSCTX_INPROC, IID_IBaseFilter,(void**)&VideoRender); pGraph->AddFilter(VideoRender,L"Video Render Device"); pGraph->AddFilter(smartTee, L"Smart Tea"); pBuilder->RenderStream(NULL, NULL,pSrc, NULL, smartTee); IPin *pPinOut, // Video port pin on capture filter. *pPinIn; // Input pin on Overlay Mixer. // Find the video port pin. pBuilder->FindPin( smartTee, // Pointer to capture filter. PINDIR_OUTPUT, // Find an output pin. &PIN_CATEGORY_PREVIEW , // Find a video port pin. NULL, // Any media type. TRUE, // Pin must be unconnected. 0, // Retrieve first matching pin. &pPinOut // Address of pointer to pin. ); // Retrieve input pin 0 on the overlay mixer. pBuilder->FindPin(VideoRender, PINDIR_INPUT, NULL, NULL, TRUE, 0, &pPinIn); //Connect the two pins. pGraph->Connect(pPinOut, pPinIn);
-
Converting Char* hex to Integer..?Thanks :):):)