|
mosimo wrote: Basically I want to make a program that will sit on top of any window so I can view IRC activity and respond
See -> SetWindowPos Function[^]
looks something like
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
With respect, I must disagree. A quick look at middle management in just about any corporation shows that the dodo not only survived, it's reproducing in record numbers. Christopher Duncan
|
|
|
|
|
Hi,
I need to capture a scrolling web page to an image file,
( Not just the images on the page ), c++ code preferred.
Does anyone know of an sdk or any examples of how to do this.
Many thanks.
|
|
|
|
|
Hi all,
How can i be able to add the Smart tee filter to the filter graph and then connect it to the video renderer to display video.
I am using the following line of code to add smart tee filter but it is not working:
CHECK_HRESULT(AddFilterByName(CLSID_LegacyAmFilterCategory, bstrDeviceName, &pSmartFilter));
Thanks and Regards,
Mayank
|
|
|
|
|
Hi all,
How can i replace RenderStream function using AddFilter or any other DirectShow function if i want to capture and display live video captured from webcam.
Regards,
Mayank
|
|
|
|
|
One way is to use AddFilter, FindPin, and Connect to manually connect filters in the capture
graph.
You can also use RenderStream, but in increments...
In your graph example
TvTuner-->TvAudio-->Crossbar-->FusionHDTV-->Video Renderer
You could build this graph by
Create an instance of the capture filter (FusionHDTV) and add it to the graph.
Create an instance of the desired video renderer and add it to the graph.
To insert an infinite tee filter, create an instance of the infinite tee filter, add it to the
graph.
IBaseFilter *pInfinitePinTeeFilter = 0;<br />
hr = CoCreateInstance(CLSID_InfTee, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&pInfinitePinTeeFilter));<br />
if (SUCCEEDED(hr))<br />
{<br />
pGraphBuilder->AddFilter(pInfinitePinTeeFilter, L"Infinite Pin Tee");<br />
}
Do whatever initialization necessary on the capture filter (so the media type is set and known).
Now connect them together..
Use RenderStream to connect the capture filter to the infinite tee filter.
pCaptureGraphBuilder2->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCaptureFilter, NULL, pInfinitePinTeeFilter);
The graph should be TvTuner-->TvAudio-->Crossbar-->FusionHDTV-->InfiniteTee at this point (the
tuner and crossbar filters should automatically be added if necessary).
Use FindPin to find the (unconnected) output pin on the tee.
IPin *pTeeOutputPin = NULL;<br />
pCaptureGraphBuilder2->FindPin(pInfinitePinTeeFilter, PINDIR_OUTPUT, NULL, NULL, TRUE, 0, &pTeeOutputPin);
Use RenderStream to connect that pin to the renderer filter
pCaptureGraphBuilder2->RenderStream(NULL, NULL, pTeeOutputPin, NULL, pRenderFilter);
The graph should be TvTuner-->TvAudio-->Crossbar-->FusionHDTV-->InfiniteTee-->Video Renderer
and the Tee will have a new output pin, which you can get using FindPin() with the unconnected
flag (like above).
I hope that helps a bit,
Mark
"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski
|
|
|
|
|
In a singleton class is it mandatory to provide a private copy of each of the three viz. default constructor, copy constructor and the assignment operator.
Also can the following code be repalced something with a notiion of new operator ie of creating the pattern on stack
class CSingleton {
public:
static CSingleton& GetInstance() {
static CSingleton theInstance; // one and only instance
return theInstance;
}
}
ie the GetInstance method could be replaced by
static CSingleton* GetInstance() {
static CSingleton* p = new CSingleton();
return p;
}
|
|
|
|
|
You only really need to make the constructor private.
After all, unless to can create an object, you can't assign anything into it, and you can't copy into it either.
And your second question... They are pretty much equivalent. references are all but identical to pointers, with the exception that you can't be NULL.
Iain.
|
|
|
|
|
Here is a code sample that I use and works fine.
CTORs and assignment operator are private
Definition
class BnBGetObjects
{
private:
BnBGetObjects(void);
BnBGetObjects(const BnBGetObjects& ref);
virtual ~BnBGetObjects(void);
void operator=(const BnBGetObjects& ref){}
static BnBGetObjects* m_pbnbGetObjects;
public:
BnBTreeControl* m_pEditTreeCtrl;
BnBSecuritiesSettingsPSheet* m_pSecuritiesPSheet;
BnBSecuritiesSettingsPPge1* m_pSecuritiesPPge1;
BnBSecuritiesSettingsPPge2* m_pSecuritiesPPge2;
public:
static BnBGetObjects *GetInstance();
void DeleteInstance();
};
Declaration
#include "StdAfx.h"
#include ".\bnbgetobjects.h"
BnBGetObjects::BnBGetObjects():
m_pEditTreeCtrl(NULL)
,m_pSecuritiesPPge1(NULL)
,m_pSecuritiesPPge2(NULL)
,m_pSecuritiesPSheet(NULL)
{
}
BnBGetObjects::BnBGetObjects(const BnBGetObjects& ref):
m_pEditTreeCtrl(NULL)
,m_pSecuritiesPPge1(NULL)
,m_pSecuritiesPPge2(NULL)
,m_pSecuritiesPSheet(NULL)
{
}
BnBGetObjects::~BnBGetObjects()
{
DeleteInstance();
}
BnBGetObjects *BnBGetObjects::GetInstance()
{
if(m_pbnbGetObjects==NULL)
m_pbnbGetObjects = new BnBGetObjects();
return m_pbnbGetObjects;
}
void BnBGetObjects::DeleteInstance()
{
if(m_pbnbGetObjects!=NULL)
{
delete m_pbnbGetObjects;
m_pbnbGetObjects=NULL;
}
}
BnBGetObjects* BnBGetObjects::m_pbnbGetObjects;
|
|
|
|
|
CMenu *SubMenu;
SubMenu = m_FloatMenu.GetSubMenu(0);
.
.
.
.
for(int i = 0;i < nRows; i++)
{
UINT Id = IDR_DYN_STAGE; //some Iteger Id
SubMenu->InsertMenuW(ID_GETJOBS,MF_BYCOMMAND,Id,CString(szStageName));
Id++;
}
SubMenu->RemoveMenu(ID_GETJOBS,MF_BYCOMMAND);
.
.
This will Create A dynamic menu from values on Database.
I want to Have an event handler (based on Id) while clocking on that item.
Neo
|
|
|
|
|
Neo.hack.net wrote: I want to Have an event handler (based on Id) while clocking on that item.
Take a look at XPrintHeader at the file XPrintHeader.cpp.
|
|
|
|
|
I know you've just typed this as an example, but you need to move the UINT Id= stage out of the loop, unless you want them all to have the same ID....
If you're in MFC, you can write a ON_COMMAND_RANGE_EX (IDR_DYN_STAGE, IDR_DYN_STAGE + large number, OnDynStage) message handler, and check if its within range as the first option inside the handler.
The _EX means you can let MFC know if it need to pass the message on or not - do a search in MSDN for more info.
Iain.
|
|
|
|
|
I am new user of Visual c++ .NET, I was Using Visual c++ MFC and Access.
1. Whow can I write the name of my program so that It can be shown in the title barre when I run my program
2. I create a menu, Whow can I load a forms from my menuitem ?( I have now two forms, the first is loaded by default, if i want to change when I click on my itemmenu, what codes to write ?
I learn my self
|
|
|
|
|
you need to change first page or open new page
Its Not clear ,Please give its detail
Regard's
Kaushik
|
|
|
|
|
Do you want to set title? see SetWindowText .
|
|
|
|
|
I am using now Visual c++ .NET
I don't know if it is this forum where I would ask.
Where to write it and whow ? syntax
|
|
|
|
|
mikobi wrote: Where to write it and whow ? syntax
It seems to your question on the previous message you said Im new to Visual c++.Net but in the continue you said I was using Visual C++ and MFC.if you used of c++.net so you must ask on the (Managed) C++/CLI[^] forum but if you use of Visual C++ you are on the correct forum.
|
|
|
|
|
I have a linked list that stores strings and there locations, I should save this list to a file and then load it from the same file, I wrote the following functions :
////Save list to a File
void list::store()
{
ofstream write;
write.open("d:\\info.txt");
if(write==NULL)
{
cout<<"Error opening File"<<endl;
return;
="" }
="" node*="" ptr="head;
" while(ptr)
="" {
="" write<<ptr-="">data<<" ";
write<<ptr->location<<" ";
ptr=ptr->next;
}
write.close();
}
////Load list to a File
void list::load()
{
string tempname,templocation;
ifstream read;
read.open("d:\\info.txt");
if(read==NULL)
{
cout<<"Error opening File"<<endl;
return;
="" }
="" while(!read.eof())
="" {
="" read="">>tempname>>templocation;
insert(tempname,templocation);
}
read.close();
}
the store function works properly, my problem is in the load function, when I run it, it fails to detect the end of file "info", so the while loop becomes infinite. how can I make it detect the end of the file ?
|
|
|
|
|
That while() loop should terminate and not be infinite.
I see one problem in your load() method - the last pair of strings will be inserted twice because
you always write a space after the strings. You shouldn't write a space after the last string
written.
Mark
"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski
|
|
|
|
|
Hi all,
I have made a sdi application and it has a splitter control in it which divide my mainframe window in two horizontal parts. Each window class is derived from ClistView.Now i want a progress bar in one class. i have found various article which have shown how to integrate a progress bar in list control.but they all say to include a class and nake a variable of that class and then use it to create element but i don't want a already created class as i have to use
CListCtrl& list = GetListCtrl();
Can anybody tell me to how to create it..
thanks in advance
|
|
|
|
|
You might have seen the utility named Windows Blinds that skins the entire windows enviroment. I am wondering how they do that? any idea? do the subclass every global control class? or what?
Polite Programmer
More Object Oriented then C#
|
|
|
|
|
how to create a destructor for a dlg.cpp class? i created a destructor for my dialog say mydialoDlg.cpp. but it shows error? how to create this? pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
What error?
You should be able to add the declaration for the destructor to the class:
class CmydialoDlg : public CDialog
{
public:
virtual ~CmydialoDlg();
};
and implement the destructor:
CmydialoDlg::~CmydialoDlg()
{
// destruct stuff here
}
"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski
|
|
|
|
|
Hi
I am making an application in vc++ using modal dialog based.
I want to print a bill report from it.(Note all entries of bill like
product serial no , quentity and price come from database (MySQL))
I can get entries from data base Now i want to print its report. How can i do this.
Can any one give me any example for it or give me some hint for making it
Regard's
Kaushik
|
|
|
|
|
Simplay open port using createfile. File name is like "COM1".....3, "LPT1"....3 and write data after formating it, and flush buffer. After printing close File.
Manish
|
|
|
|
|
sir ji
i am new in vc++ and this is my first application .
can you give me any example related to this or any atricle link.
Regard's
Kaushik
|
|
|
|