|
You have already got the answer in the C/C++ forum...
Don't post the same question to multiple forums!
|
|
|
|
|
Hi everybody,
I am using shock wave flash control on a dialog. I able to play the movie file(.swf file) But I want to make the background as transparent while playing the swf file.There is an article named "transparent flash control in plain C++" that solved this problem, but the usage of cpu is too high.Does someone have a solution?
Thanks!
|
|
|
|
|
The performance of iceProjector is better than most other programs'. It's a good idea to transparent the flash with windows region.
|
|
|
|
|
I use ADO + MS SQL2000 ,I don't hope the window hang,when I read the records in the main thread.
So I use other thread to read the datebase.Just like this:
(if I didn't use thread,this record is the last one.)
void CxxDlg::UpdateListCtrl()
{
CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)StartRead,this,NULL,NULL);
Sleep(100);
}
DWORD WINAPI CxxDlg::StartRead(LPVOID lParam)
{
CoInitialize(NULL);
CxxDlg *pDlg = (CxxDlg *)lParam;
ASSERT( pDlg != NULL );
_variant_t vA,vB,vC,vD;
CString strTemp;
int nItem,nCount;
try
{
pDlg->m_List1.DeleteAllItems();
m_pRecordset.CreateInstance("ADODB.Recordset");
strTemp.Format("select * from db_somedate");
m_pRecordset->Open((_variant_t)strTemp,_variant_t((IDispatch*)
m_pConnection,TRUE),adOpenStatic,adLockOptimistic,adCmdText);
while(VARIANT_FALSE == m_pRecordset->adoEOF)
{
vA = m_pRecordset->GetCollect("A");
vB = m_pRecordset->GetCollect("B");
vC = m_pRecordset->GetCollect("C");
vD = m_pRecordset->GetCollect("D");
nItem = pDlg->m_List1.InsertItem(0,(_bstr_t)vA);
pDlg->m_List1.SetItem(nItem,1,1,(_bstr_t)vB,NULL,0,0,0);
pDlg->m_List1.SetItem(nItem,2,1,(_bstr_t)vC,NULL,0,0,0);
pDlg->m_List1.SetItem(nItem,3,1,(_bstr_t)vD,NULL,0,0,0);
m_pRecordset->MoveNext();
}
nCount = pDlg->m_List1.GetItemCount();
pDlg->m_List1.SetFocus();
pDlg->m_List1.SetItemState(nCount-1, LVIS_SELECTED, LVIS_SELECTED);
pDlg->m_List1.EnsureVisible(nCount-1,FALSE);
}
catch (_com_error e)
{
CString errormessage;
errormessage.Format("Connect Datebase failed.\r\n\r\nError code:%s",e.ErrorMessage());
return DATE_FAILED;
}
return DATE_SUCCESS;
}
|
|
|
|
|
Hi,
I try to include
#include "stdafx.h"
class CSofphoneView : public CFormView ,public IDispEventSimpleImpl<1, CSofphoneView,&DIID__IUccEndpointEvents>
in App & View class its working
when I create new c++ class “CCallcontrol” without base class and include
#include "stdafx.h"
class CCallcontrol :public IDispEventSimpleImpl<1, CCallcontrol, &DIID__IUccEndpointEvents>
but its gets below error. Give me the suggestion .
c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h(4211) : error C2039: '_GetSinkMap' : is not a member of 'CCallcontrol'
1> d:\shanthakumar\sofphone\sofphone\callcontrol.h(9) : see declaration of 'CCallcontrol'
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h(4210) : while compiling class template member function 'HRESULT ATL::IDispEventSimpleImpl<nid,t,pdiid>::Invoke(DISPID,const IID &,LCID,WORD,DISPPARAMS *,VARIANT *,EXCEPINFO *,UINT *)'
1> with
1> [
1> nID=1,
1> T=CCallcontrol,
1> pdiid=& DIID__IUccEndpointEvents
1> ]
1> d:\shanthakumar\sofphone\sofphone\callcontrol.h(11) : see reference to class template instantiation 'ATL::IDispEventSimpleImpl<nid,t,pdiid>' being compiled
1> with
1> [
1> nID=1,
1> T=CCallcontrol,
1> pdiid=& DIID__IUccEndpointEvents
1> ]
in “stdafx.h” included
#include "afxsock.h" // MFC socket extensions
#include "afxcview.h" // MFC declaration for CTreeView
#include "atlbase.h" // ATL Base
#include "atlcom.h" // ATL COM
#include "atlcoll.h" // for CAtlMap
#include "atlctl.h"
Thanks&Regards
shakumar
modified on Monday, July 5, 2010 3:43 AM
|
|
|
|
|
Edit you post so we can read it properly: we can't see any < or > characters or what's between them.
Steve
|
|
|
|
|
I have createc an IE ExplorerBar using this tutorial (the source code is available here http://www.codeguru.com/forum/showthread.php?p=1949199#post1949199) which consists of a Deskband (Vertical ExplorerBar).
In this project CCGBandObj is the class which loads the explorer bar and displays an html page on to the deskband and I have used 2 pointers of IWebBrowser2 to store the handle of both the explorerbar and main window
CComPtr<IWebBrowser2> m_spBrowser;
IWebBrowser2* m_pMainWB;
I am using this invoke method to capture various page events like before navigation, document complete, refresh etc
STDMETHODIMP CCGBandObj::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
DISPPARAMS* pDispParams, VARIANT* pVarResult,
EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
if (IID_NULL != riid)
{
return DISP_E_UNKNOWNINTERFACE;
}
if (!pDispParams)
{
return DISP_E_PARAMNOTOPTIONAL;
}
switch (dispIdMember)
{
case DISPID_BEFORENAVIGATE2:
{
HWND pHWND;
m_pMainWB->get_HWND((long *)&pHWND);
}
break;
case DISPID_DOCUMENTCOMPLETE:
{
HWND pHWND;
m_pMainWB->get_HWND((long *)&pHWND);
m_spBrowser->Navigate(L"http://u-2-me.com/seminar/search/searchresult", NULL, NULL, NULL,NULL);
IDispatch *pHtmlDocDisp;
IHTMLDocument2 *pHtmlDoc;
HRESULT hr = m_pMainWB->get_Document(&pHtmlDocDisp);
if (SUCCEEDED(hr))
{
hr = pHtmlDocDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pHtmlDoc);
if (SUCCEEDED(hr))
{
BSTR bsTitle;
hr = pHtmlDoc->get_title (&bsTitle);
if (SUCCEEDED(hr))
{
CString str;
SysFreeString(bsTitle);
str = bsTitle;
str.Delete(str.Find("-"), str.GetLength());
}
pHtmlDoc->Release();
}
pHtmlDocDisp->Release();
}
}
break;
case DISPID_REFRESH:
{
HWND pHWND;
m_pMainWB->get_HWND((long *)&pHWND);
m_spBrowser->Navigate(L"http://u-2-me.com/seminar/search/searchresult", NULL, NULL, NULL,NULL);
}
break;
default:
return DISP_E_MEMBERNOTFOUND;
}
return S_OK;
}
Now my main challange is
First Priority: Whenever the user click the links displayed in ExplorerBar window, it should display the resultant page in the main browser windows
Second Priority: When the user clicks on any of the link displayed in ExplorerBar Window, the exploreBar window should hide and when the user loads something else in the main window or roloads something, the ExploreBar window should show again.
How can I accompalish all this?
Thanks in Advance
Maverick
|
|
|
|
|
Hi
How to get Drive name of current OS installed. Is there any win32 API for this.
Thanks
Abm
|
|
|
|
|
|
Can one of you WTL gurus recommend a simple way to display controls in a gui editor created tab control?
I find myself having to create a WTL-based application for work. Although I have extensive experience with other languages and APIs, I have no experience with MFC/ATL/WTL, and the learning curve has been steep. I've managed to figure out a lot on my own, and am getting the hang of how things work.
The last thing I need to figure out is how to use the tabbed control. For starters I've created a dialog-based application using the gui editor, and one of it's components is a tab control added from the toolbox. I've figured out how to determine when a tab is selected, which one it was, and take action accordingly. What I can't seem to figure out how to do is to display different controls in the tab control depending on which tab is selected (I'm guessing that the easiest way would be to create a couple of dialog windows, then display them when the corresponding tab is selected).
I've looked at some of the examples posted around the internet, but none seem to directly use the editor-created tab control. It's entirely possible that I'm missing something obvious; as I mentioned I lack the background that makes learning this easy.
My question for you WTL gurus is: what's the easiest way to go about this? Obviously I need to do some more learning, but for now any suggestions, help, referrals to concrete examples, etc., would be greatly appreciated. I'm using VS 2005.
Thanks!
-- Modified Wednesday, June 23, 2010 2:19 PM
|
|
|
|
|
I created dialogs with the resource GUI editor to be the pages in my tabbed control so they appear in my rc file as below:
IDD_PSS_DIALOG DIALOGEX 0, 0, 589, 442
STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CLIENTEDGE
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,306,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,306,24,50,14
....
Then declared dialog classes in the usual way:
class CPSSStatusDlg : public CDialogImpl<CPSSStatusDlg>,
public CWinDataExchange<CPSSStatusDlg>,
public CDialogMessageHook
{
...
public:
CPSSStatusDlg();
enum { IDD = IDD_PSS_DIALOG };
...
};
...
created dialog objects:
...
CAboutDlg m_about;
CTH450StatusDlg m_statusDlg;
CViXStatusDlg m_StackerStatusDlg;
CPSSStatusDlg m_PSSStatusDlg;
...
and then loaded the the dialog objects onto mt tab pages:
m_tabView.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
m_about.Create(m_tabView.m_hWnd,rcDefault, NULL);
m_statusDlg.Create(m_tabView.m_hWnd,rcDefault, NULL);
m_StackerStatusDlg.Create(m_tabView.m_hWnd,rcDefault, NULL);
m_PSSStatusDlg.Create(m_tabView.m_hWnd,rcDefault, NULL);
m_tabView.AddPage(m_about.m_hWnd, _T("Task Control"));
m_tabView.AddPage(m_statusDlg.m_hWnd, _T("Arm Control"));
m_tabView.AddPage(m_StackerStatusDlg.m_hWnd, _T("Stacker Drive"));
m_tabView.AddPage(m_PSSStatusDlg.m_hWnd, _T("PSS Overview"));
|
|
|
|
|
Ok, here is the story. Till now I have a dialog based application which uses a COM object to communicate with a third party hardware. For this in vc++6 I used to do as follows
-Add a new ATL object to the project
-Include/import the necessary files
#include "thirdparty.h"
#import "_thirdparty.tlb" no_namespace
using namespace std;
-Define a variable
CComPtr<IHostDrv> pIHostDrv;
-in cpp file
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(__uuidof(CHostDrv), NULL, CLSCTX_INPROC_SERVER, __uuidof(IHostDrv), (LPVOID *) &pIHostDrv);
if (SUCCEEDED(hr) && pIHostDrv)
{
//do blah blah..
}
everything works great.
Now I am moving my application to VC++2008 and I got everyting cleaned up (all warning messages and that sort of stuff) and the program complied fine. But when I run it, the CoCreateInstance returns with an error 0x80020008 (which is bad variable type). --- this error is still there even after replacing the tlb/lib files with ones generated using VC++2008.
//the following crash error has been resolved by recreating tlb and lib files on VC++2008
So I thought maybe ATL interfacing is different in VS2008, so I started out with a simple MFC dialog based application and tried to create COM object as follows (following MSDN)
-Create the MFC project
-Add new class and then ATL Support to MFC code, then I do the same as above and now the program crashes on CoCreateInstance method (Unhandled exception at 0x003f1978 in VS2008test.exe: 0xC0000005: Access violation.)
But when I run the sample project (which is also a dialog based app) that uses this library provided by third party company (which was created in VS2005) in VS2008, it runs fine and I checked the commands and they were exactly the same I am using in mine. I am a bit lost now , anyone have any ideas why I am having this problem (bad variable type)??
thanks,
PKNT
modified on Tuesday, June 22, 2010 7:30 PM
|
|
|
|
|
Is there any way i can extract the contents relevant to a currently loaded webpage?
For example
1) suppose someone is loading nVidia's website then 'Graphic Card' is the relevant of that webpage.
2) If someone is loading World Cup Soccor website then 'Soccor' is the relevant content of that page.
3) If someone searched for Gadgets in google search, then 'Gadgets' is the relevant content of the search result.
So is there any technique to extract relevant contents of a webpage? I know using IHTMLDocument2 we can extract complete html contents of a webpage. But search engines like google, yahoo etc doers'nt allow you to se its HTML contents.
What I wanna accompalish is something similar to this.
https://addons.mozilla.org/en-US/firefox/addon/8394/
Can someone help me out with this?
Thanks in Advance
Maverick
|
|
|
|
|
Adeel Mirza wrote: So is there any technique to extract relevant contents of a webpage?
Yup. Imagine having a table in a database, where you link the "HowTo" video's to individual keywords. Retrieve the HTML when a page loads and check if it contains any keywords that are in your table. If so, display the videos that go with those keywords.
I are Troll
|
|
|
|
|
I developed a Vertical IE Explorerbar using this artical
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4395
Now my next assignment is, whenever someone searches for anything in google or yahoo. My application should trap that keyword and display the search result using my websites search engine that explorer bar. How can I accompalish this?
Thanks in Advance
Maverick
|
|
|
|
|
Adeel Mirza wrote: whenever someone searches for anything in google or yahoo.
How would they do this, do you mean using IE or your application?
It's time for a new signature.
|
|
|
|
|
Sorry for the confusion, IE Addin was developed using ATL COM. So by application I mean the Addin. So I want the Addin to capture the keyword that was typed in the searchbar of google, and then my site itself has a search engine.
So it should query that keyword in my site's search and display the result page in the left explorerbar window
Maverick
|
|
|
|
|
I think you may need to talk to the person who developed the addin, it's not clear from your question how it interfaces with the address bar.
It's time for a new signature.
|
|
|
|
|
Not the address bar, I need to extract the keyword entered in google or yahoo search
Maverick
|
|
|
|
|
Sorry, I've no idea if that is possible, the contents of Google/Yahoo pages are controlled by their respective servers and driven by script within the pages. You might like to try posting this query to the Web Development or ASP.NET forums to see if anyone there has any ideas.
It's time for a new signature.
|
|
|
|
|
I think I am unable to explain properly. Lets make it simple. Lets say I have that IE Toolbar installed and some user typed 'Silver' in google or yahoo search. Now my IE Toolbar should extract this keyword 'Silver' when the user pressed search button. So I don't think it should be that hard. So can someone tell me how can this be accompalished.
Maverick
|
|
|
|
|
Adeel Mirza wrote: Now my IE Toolbar should extract this keyword 'Silver' when the user pressed search button.
So you need to find some method of intercepting the button press, if that is possible.
It's time for a new signature.
|
|
|
|
|
Yes. Not really intrcepting that button. Whenever someone press the search button. iHtmldocument2 should have a way to extract the keyboard that was send using http send / post methods. I am not sure though thats why I posted this question
Maverick
|
|
|
|
|
The problem is that pressing these buttons does not trigger a search action within IE, but rather a post back or script action in the web page. This will then send information back to the web site where the actual search takes place. I have no idea how you would capture this action but, as I suggested previously, it has nothing to do with ATL and is more likely to get an answer in the ASP.NET or Web Development forums.
It's time for a new signature.
|
|
|
|
|
In this case, what will ASP.NET or any other web development do? Its not that I am using or developing my own customized page. I am taking it from google or yahoo
Maverick
|
|
|
|
|