|
when I use your CScrollCtrl on a dialog bar, there is something error when switching show/hide the dialog bar, I have made a test, but I don't know how to post it, I really hope shog9 can help me to deal with this problem, when you hide the dialog bar and show it again, there will pop up a error message about assert failure in wincore.cpp line 628. I want to mail the test source code to you, but I don't know how to contact with you
swandream
|
|
|
|
|
I make a windows service with ATL,and when I want to open a database in the service work thread(I creat a new thread), it doesn't work??? And when start the service in SCM, a error show: debug error ??? I don't know why?
Please help me , and if you have one sample ,give me one?
and my code below:
//if( !m_db.Open( _T("SmsSendBuff"),FALSE,TRUE,_T("ODBC;UID=saWD=") ) )
//these two open operation doesn't work both!!!
//if(!m_db.OpenEx("DSN=SmsSendBuff;UID=saWD=",CDatabase::noOdbcDialog);
_ConnectionPtr Conn1("ADODB.Connection") ;
HRESULT hr=Conn1.CreateInstance( __uuidof( Connection ) );
_bstr_t bsDSN = (L"SmsSendBuff");
_bstr_t bsEmpty = L"";
Conn1->ConnectionString = bsDSN;
//hr = Conn1->Open("dsn=SmsSendBuff;uid=sa;pwd=;","","",0);
AfxMessageBox("open...db");
hr=Conn1->Open(bsDSN,_bstr_t("sa"),_bstr_t(""),-1);/*bsEmpty, bsEmpty, bsEmpty, -1 );*/
my email and msn: diyzhaodiyzhao@hotmail.com
I'll be appreciated if getting your help!Thank you!
|
|
|
|
|
Did you call CoInitialize() in the work thread before you create the COM instance? CoInitialize() (or CoInitializeEx()) has to be called on every new thread...
|
|
|
|
|
I ran into this once -- and for my case it had to do with where I installed the ODBC DSN -- when running as a console application, it was OK to have the DSN be registered as a "User DSN".
But as a service, it needed to be registered as a "System DSN"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
to:Peter Weyzen
I had the DSN be registered as a "User DSN",the code did't work, and now it is registered as "System DSN",the code works.
but I don't known why must I create the DSN as "System DSN"?
Thank you for your help,and thanks to Wout Louwers, thank you!
|
|
|
|
|
I've not investigated the "why" -- but if I were to guess, I'd assume that it all depends on how the service is installed.
I assume it's a security issue:
If the service is bound to a user -- like you -- then it would use your User-DSN. But if your service is not bound to a user, but to "LocalSystem", then your User-DSN's are not available...
That's just my guess, but it makes good sense.
-p
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
to:Peter Weyzen
you said:
"That's just your guess, but it makes good sense."
YES, I think with this entirely.
Thank you for your help, thank you.
|
|
|
|
|
Does anyone know how to get the first frame of an compressed AVI?
Using the AVI-APIs the AVIStreamGetFrameOpen is returning a NULL when the video stream is compressed. Works fine for non compressed videos.
I also tried the suggestion from Jung Jinhyuck ( http://www.codeproject.com/audio/avitowmv.asp ) which looked very promising.
Looks like the decompression is not done, but the same compressed AVI can be viewed with the Media player on the same machine. Thought the AVI-API could access the same decompressors.
(Using WinXP and VC .NET)
Thanks
Jürgen
|
|
|
|
|
Use DirectShow, which is probably total overkill for one frame.
You can make sure that the correct decompressors are in the graph using GraphEdit, I think an older version of DirectX (7 or 8?) may have even had a sample program for grabbing a single frame.
|
|
|
|
|
Thanks for your suggestion.
I just wanted to give the icons in my listview a small preview of the AVI files from my camera
Wouldn't introducing DirectShow to an app make a dependency on the DirectShow components installed on the system?
For example I use the latest version of DirectShow but the system has an older version installed?
Thanks
Jürgen
|
|
|
|
|
Dear Everybody,
I am facing problem putting a trasperent Bitmap(i. a logo) on running video screen. I am using Win 32 API.
I will put the problem in detail. The bitmap is a logo and has 2 colors white over black background. I need to show only the white part of the .bmp on the video widow and the black portion of the bitmap should show the background video.
Does anybody have a solution... Please reply soon.
Regards,
Abhi
|
|
|
|
|
I can only sujest you look at using regions: SetWindowRgn(). You might try seaching codeproject for the article on using regions with vector graphics: it shows how to place a region around a vector graphics image so that the image it self is the window.
Trust in the code Luke. Yea right!
|
|
|
|
|
i created a win32 api app (no MFC) and it has a dialog
how do i add an activex control on the dialog
(i tried adding it thru the dialog editor but the app didn't start up correctly, cuz i probably didn't do any code for the control)
someone please enlighten me
Roman Nurik
|
|
|
|
|
AX control hosting is quite complex. Your dialog isn't appearing because when you use the VC resource editor, it puts a placeholder into the dialog template, not the actual control. Both MFC and ATL recognize the placeholders and insert their own control hosting code to manage the control.
You app would have to do something similar. The easiest route would be to use ATL for that dialog and let it handle the hosting duties.
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
oh... in that case:
1) how can i add ATL to my dialog, without really complicating a pretty small utility
2) can i play an MP3 using something other than Windows Media Player ActiveX (that is the control i need... to play an MP3)
Roman Nurik
|
|
|
|
|
In your stdafx.h (or whatever your main header file is) remove the include of windows.h, and instead put:
#include <atlbase.h>
extern CComModule _Module;
#include <atlwin.h> In the CPP file that has WinMain() , declare the global _Module . Change WinMain() thus:
int WinMain ( HINSTANCE hinst, ... )
{
_Module.Init ( NULL, hinst );
.....
_Module.Term(); return msg.wParam;
}
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
is there any one who know how i can add DIALOGBAR in one application,because i want to add it in my application in the long of the right of window and i will add in it some control as slider buton ......
|
|
|
|
|
Is it posible to put buttons or other controls in the view in a View-Document app? and how can I do it?
tks in advance..
Daniel Cespedes Daza
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
Definitely. One solution is to add the button as a member variable and call Create().
Kuphryn
|
|
|
|
|
When you use AppWizard to create your application, you could try setting the view base class to CFormView (on the last but one page of the wizard IIRC). This allows you to define your view using a dialog template.
If you have a CView derived view, then you'll have to create them dynamically.
|
|
|
|
|
Is there a native way (not through redefinition with UNION) to pass a pointer of an array by address to a function, so that the function can change the pointer and pass back the changed value?
|
|
|
|
|
Yeah. Like this:
void DoSomething( int ** p_ppiArray )
{
*p_ppiArray = new int[10];
}
void SomeOtherFunction()
{
int * a_piArray = NULL;
DoSomething( &a_piArray );
delete [] a_piArray;
}
Chris Richardson Terrain Software
|
|
|
|
|
Thanks Chris; it's working already.
I tried it with "double-ptr" in the form **array[], but that did not work.
|
|
|
|
|
Hi,
I use the commande : pDoc->OpenDocumentFile(NULL); (where pDoc is a pointeur of CMUltiDocumentTemplate) to open a new document of type CFrameView.
I'm using a tabctrl class for swicthing between multiple document in a mdi (CMDITabs from Christian Rodemeyer) and i'd like to have a top CFrameView on top even if a new document is open.
Is there a way to do this ?? Thank you very much
|
|
|
|
|
in VC 6.0, i use CHtmlView, but it can not load java swing (jdk 1.2 and above) controls.
how to solve the problem?
thx
includeh10
|
|
|
|