|
I checked OSR Online, It is a very useful web site for WDM developers.
Thanks Mike,
A. Riazi
|
|
|
|
|
Hi all programmers!
Does anybody know how to set the attribute to Hidden for a file using VC++.
I have only found how to set attributes like Read-only.
Martin_j
|
|
|
|
|
Both attributes can be set with SetFileAttributes .
|
|
|
|
|
Hello all
I'm using ComboBox control and adding some strings to it. Assume that I'm adding 4 strings to ComboBox and at runtime if I select dropdown from ComboBox it's showing only two elements where to see the next two I need to scroll down.
My question is there anyway to see the entire list when dropdown is selected. If anyone knows how to do it, please help me.
Thanks for your help.
Hari.
|
|
|
|
|
Yes, you can enlarge the size at design time by clicking on the arrow and resize the rectangle to the size you want (if it's bigger than all the strings it contains, it will be clipped).
Hope this helps
|
|
|
|
|
Hello Cedric
Thanks for the reply, now I'm able to view all the list items.
Thanks for your time.
Hari.
|
|
|
|
|
You're welcome
haritadala wrote:
Thanks for your time.
Hum, I think my time is not sooo precious
|
|
|
|
|
How can I link to a .lib file in the .NET IDE?
Themis
|
|
|
|
|
In Project Properties, go to Configuration Properties > Linker > Input and add your .lib file to the Additional Dependencies field.
|
|
|
|
|
Where are the project properties? I can't find them.
Themis
|
|
|
|
|
Ah yes, the amazing disappearing menu option...
In the Solution Explorer panel, highlight your project. Go to the Project menu > Properties.
I think the idea was that the properties dialog would be context sensitive, but for someone coming from VC6, it's just annoying.
Note that the dialog isn't modal - if you click something else in Solution Explorer you'll get properties for that instead. If you click an editor window the dialog changes to a window reading 'There are no property pages for the selection'.
|
|
|
|
|
It's really amazing how magnificiently they hid it!
Thank you, Themis
|
|
|
|
|
I want to add MouseDown Event on my CButton
I try to make my class so that it inherits from CButton.
Still no luck. Please help me to solve this!!
|
|
|
|
|
Derive your own button class from CButton, e.g. CYourButton.
If you have a button in your dialog, e.g. IDC_BUTTON, do this in OnInitDialog:
m_YourButton.SubclassDlgItem(IDC_BUTTON, this);
and in the.h file: CYourButton m_YourButton;
Add the mouse button down message handler in CYourButton.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Thanks for your quick post.
I tried to add the MouseDown event(it is going to be
protected member, rigth!?) on CYourButton
and those parts you mensioned in red, but
when i tried to debug and put a break point
inside of MouseDown Event, it doesn't go to
CYourButton. I am missing something here?
Thanks for your help.
Shin
|
|
|
|
|
You are not giving me a lot of information to go on.
Anyway, if you add CYourButton in the class view and then use the Class Wizard to add a message handler for WM_LBUTTONDOWN (in CYourButton), your derived button class should look something like this:
.h:
class CYourButton : public CButton
{
public:
CYourButton();
public:
public:
public:
virtual ~CYourButton();
protected:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
.cpp:
CYourButton::CYourButton()
{
}
CYourButton::~CYourButton()
{
}
BEGIN_MESSAGE_MAP(CYourButton, CButton)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CYourButton::OnLButtonDown(UINT nFlags, CPoint point)
{
TRACE("> Left mouse button down\n\r");
CButton::OnLButtonDown(nFlags, point);
}
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Fredrik Thank you very much,
seems like i had to put presubclasswindow in my dialog class.
Now it's working.
Thanx
Shinya
|
|
|
|
|
How to input Greek in VC++(.h, .cpp)?
How to input Greek in VC++ resource(.rc)?
How to show Greek in English Windows98 or Windows2000?
Thank!
|
|
|
|
|
I have a "parent" application. I want to create and destroy a child process using the parent application. I am successfully creating a new process (notepad) but unable to destroy it. Can any one tell me how to destroy a process ?
For creation of process i am doing something like:
STARTUPINFO si;
PROCESS_INFORMATION pi;
GetStartupInfo(&si);
::CreateProcess(NULL, "notepad",
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&si,
&pi);
and for ending process i am doing:
DWORD exitCode ;
BOOL a =::GetExitCodeProcess(pi.hProcess, &exitCode);
::ExitProcess(exitCode);
But when i try to end process my parent process destroys itself. Very strange that if i use TerminateProcess instead of ExitProcess , the child process successfully ends. But i want to use ExitProcess because MSDN recommends it. What is the problem here ?
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote:
But when i try to end process my parent process destroys itself. Very strange that if i use TerminateProcess instead of ExitProcess, the child process successfully ends.
It's not strange at all. This is exactly what the docs say will happen. ExitProcess() exits the current process, TerminateProcess() terminates another process.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Note that TerminateProcess is extremely brutal. If you can, try to find top-level windows belonging to that process (see EnumWindows and GetWindowThreadProcessId ) and send them a WM_CLOSE message. This will allow the process to tidy up properly before it quits.
|
|
|
|
|
Mike Dimmick wrote:
Note that TerminateProcess is extremely brutal.
Absolutely. I like being brutal
But yes, it's not really a good idea to use. It doesn't allow the process to finish whatever it's doing, and files and settings may become corrupted.
Mike Dimmick wrote:
If you can, try to find top-level windows belonging to that process (see EnumWindows and GetWindowThreadProcessId) and send them a WM_CLOSE message.
If it has a window and is behaving itself this will work. If it has no window, use PostThreadMessage() to post a WM_QUIT message to the application's main thread (use the toolhelp library to get the thread id of the main thread of the process). If this doesn't work, then TerminateProcess() is the only alternative (or do nothing of course).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, all
i capture the images from the video input source(eg. cam) by using directshow's ISampleGrabberCB's callback function. but now i need to change the output's resolution from 320*240 to 640*480, the capture image's size also need to be changed into 640*480, anyone knows how can i do that? thanks
|
|
|
|
|
1/ Find the output pin of the source filter
2/ Query the pin for the IAMStreamConfig interface
3/ Use IAMStreamConfig::GetNumberOfCapabilities() to find the number of alternative output configurations
4/ Use IAMStreamConfig::GetStreamCaps() to evaluate all the possible AM_MEDIA_TYPE's
5/ Remember to delete the AM_MEDIA_TYPE's after you're finished with them.
You are probably going to have to specify a media subtype as well as the resolution. Typically MEDIASUBTYPE_RGB24 for most web cams
The following code is far from perfect... but it's what i'm using at the moment
CComPtr<IPin> findPin(CComPtr<IBaseFilter>& pFilter, PIN_DIRECTION dir)
{
PIN_DIRECTION pinDir;
CComPtr<IEnumPins> pPinEnum;
pFilter->EnumPins(&pPinEnum);
while(1)
{
CComPtr<IPin> pPin;
if( pPinEnum->Next(1,&pPin,0) == S_OK )
{
pPin->QueryDirection(&pinDir);
if(pinDir == dir)
{
return pPin;
}
}
else
{
return CComPtr<IPin>();
}
}
}
void setFormat(int width, int height, const GUID& subtype)
{
int size;
int count;
VIDEO_STREAM_CONFIG_CAPS vscc;
CComPtr<IPin> pPin = findPin(pSrc_,PINDIR_OUTPUT);
CComQIPtr<IAMStreamConfig> pConfig(pPin);
pConfig->GetNumberOfCapabilities(&count, &size);
for(int i = 0; i < count; i++)
{
AM_MEDIA_TYPE *pMt;
pConfig->GetStreamCaps(i, &pMt, (BYTE*)&vscc);
if( (vscc.InputSize.cx == width) &&
(vscc.InputSize.cy == height) &&
(pMt->subtype == subtype) )
{
pConfig->SetFormat(pMt);
DeleteMediaType(pMt);
return;
}
DeleteMediaType(pMt);
}
}
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I have been working with tapi to init the modem, answer a phone call(all this works so far!!), and then stream what the caller says(raw 16 bit data) into a buffer. The problem i am having is in my waveInOpen(...) call to set up the data connection with the phone call. waveInOpen returns with an error saying the device is already in use. Any help or suggestions would be great.
here is what i am doing:
1. open the line with lineOpen( ) (i have monitor and owner privleges)
2. Once i am connected to a call i get the waveID with lineGetID(....)
3. I then try to call waveInOpen( &m_hRecord, m_iCallID, &m_Format, m_ThreadID, NULL, CALLBACK_THREAD) where m_iCallID is the id return in step 2 and this returns the error.
Does anyone know how to open a tapi call with waveInOpen to have access to the raw data? Thanks for the help.
Steve G
|
|
|
|