|
paper67 wrote: Thx a lot.
My Pleasure
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How about the old standby, sscanf ? There is also a wide-character version, swscanf . If you've eliminated the whitespace around the string-represented floating-point value, then the following will work:
float fValue;
int nResult = sscanf((LPCTSTR)sData, "%f", &fValue);
if( nResult != 1 )
{
}
Bob Ciora
|
|
|
|
|
wcstod() contained in <stdlib.h >
~RaGE();
|
|
|
|
|
Is there ready lib or dll for VC++ to capture video from usb camera with available function to get a single captured frame to Memory Array in different types of byte stream (rgb,gray,yuv, etc...) or just in any one type?
9ine
|
|
|
|
|
if what cam ur using
if u r using logitech web cam
the sdk is avaliable in logitech site
u need to install driver first
any how ,if u r using any other u have lot many no of open sources
like vision, and lot many, search in google u will get lot many
All the best
bye
kattavictor
|
|
|
|
|
I found that windows sound recoder could show the "Sound Selection" dialog to let user set the format and attributes of the recorded audio file, some other programs could show the dialog too.
So I think there must be a windows API that could call this Dialog, I need it
in my program. Does anyone know how to call it?
http://www.yesalbum.com/v001/aisonbert/sound_selection_dlg.jpg[^]
Thanks in advance!
Bert
-- modified at 4:39 Tuesday 6th December, 2005
|
|
|
|
|
You can use some of the control panel functions and thus invoke it directly.
See this MSDN topic : Executing Control Panel Items
|
|
|
|
|
hi
i want to copy a variant into void* variable i.e.
void* voidpvar;
VARIANT varvar;
i cant do voidpvar=varvar or varvar=voidpvar
What to do?
thanks
|
|
|
|
|
|
i want to terminate any running programme. is any API call. pls tell me
|
|
|
|
|
TerminateProcess is what you are looking for.
|
|
|
|
|
TerminateProcess(HANDLE hProcess, UINT uExitCode);
hProcess can be obtained by:
OpenProcess(...);
this is this.
|
|
|
|
|
::PostMessage(handle_to_kill, WM_CLOSE);
using WM_QUIT should work too, ,but i don't know the difference between them.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Hi,
The WM_QUIT message is not associated with a window and therefore will never be received through a window's window procedure.
The WM_CLOSE message is sent as a signal that a window or an application should terminate.
Do not post the WM_QUIT message using the PostMessage function; use PostQuitMessage.
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Cool Ju wrote: Do not post the WM_QUIT message using the PostMessage function; use PostQuitMessage.
In context on original problem posted by User,Sorry for correcting you.. You cannot use PostQuitMessage to terminate/close other process .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I should have posted my comment clearly. Thanks for correcting it.
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I did a project in VC++ 6.0 in windows XP but when I run the same exe in windows 98, the default font type and size of the modal dialog box changes. (The font in the caption bar of the main frame and child frame is the default) Wut is the problem? Should i give default font type and size in DoModal() function?
|
|
|
|
|
In Window XP if a Window function has a string argument,it manipulates or handles the string as Unicode (even if the code is not compiled as unicode).This is not in Window 98
|
|
|
|
|
sunit5 wrote: In Window XP if a Window function has a string argument,it manipulates or handles the string as Unicode (even if the code is not compiled as unicode).This is not in Window 98
You are right in windows XP, the string args are treated as unicode wheather it unicode or not (internally). But little correction you Sir!.. users problem is not related with UNICODE.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Arrun wrote: Wut is the problem? Should i give default font type and size in DoModal() function?
That’s the common Problem.. As Font Setting is different for different computer /OS + User can easily change it (By applying new theme, changing display setting etc) .. It is always good to set your own default font when designing software...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I am trying retrieve summary information of the file.
I was using stgOpenStorage API. My code is working only for Word documents and text files.
I need this for mpeg,jpeg & wmv files.
The following is the code i am using.
try
{
hr = StgOpenStorageEx( L"D:\\Photos\\daffs-768.jpg",
STGM_READ|STGM_SHARE_DENY_WRITE ,
STGFMT_ANY,
0, NULL, NULL,
IID_IPropertySetStorage,
reinterpret_cast<void**>(&pPropSetStg) );
if( FAILED(hr) )
throw L"Failed StgOpenStorageEx";
IUnknown *pUnk = NULL;
hr = pPropSetStg->QueryInterface (IID_IUnknown,(void**)&pUnk);
hr = pPropSetStg->Open( FMTID_SummaryInformation, STGM_READ | STGM_SHARE_EXCLUSIVE,
&pPropStg );
if( FAILED(hr) )
throw L"Failed IPropertySetStorage::Open";
// Read the property back and validate it
hr = pPropStg->ReadMultiple( 1, &propspec, &propvarRead );
if( FAILED(hr) )
throw L"Failed IPropertyStorage::ReadMultiple";
if( S_FALSE == hr )
throw L"Property didn't exist after reopening the property set";
else
{
int len = strlen(propvarRead.pszVal);
WCHAR* data = new WCHAR[len];
mbstowcs(data,propvarRead.pszVal,len);
wprintf(data);
delete data;
}
}
catch( const WCHAR *pwszError )
{
wprintf( L"Error: %s (hr=%08x)\n", pwszError, hr );
}
Please help me how to do this.
|
|
|
|
|
What can be issue of using EVENTS object for single instance application for single user on a desktop.
I have seen this method given in the link, which is quite clean solution to the problem but using mutex and then boradcasting message is bit concern.
http://www.codeproject.com/threads/simplesingleinstanceapp.asp[^]
Here is what I inted to do when using events for process communication.
step1:
Create an unique event in the ininstance method in Reset mode.
Check if event is already created.
If event not created then create event and create screenControl thread to listen for set/reset of that event.
If event is there then means window is already present and hence
set the event here so that running thread can wakeup.
// OnlyOne.cpp
// global data
HANDLE hEvent;
int ShutDownFlag;
void ScreenMonitor(LPVOID pParam);
// COnlyOneApp initialization
BOOL COnlyOneApp::InitInstance()
{
///// other stuff...
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(COnlyOneDoc),
RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(COnlyOneView));
AddDocTemplate(pDocTemplate);
//------
hEvent = CreateEvent(NULL,TRUE,FALSE,_T("ONLYONE-APP"));
AlreadyRunning = ( ::GetLastError() == ERROR_ALREADY_EXISTS || ::GetLastError() == ERROR_ACCESS_DENIED);
if (AlreadyRunning) {
MessageBox(NULL,"Already Running....","Message!!",MB_OK);
SetEvent(hEvent);
return TRUE;
}
//-------
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//--------
CWinThread *wndThread = AfxBeginThread((AFX_THREADPROC)ScreenMonitor, m_pMainWnd->GetSafeHwnd(),THREAD_PRIORITY_NORMAL,0,0);
if (wndThread == NULL)
{
MessageBox(NULL,"Could not Create Thread...","MSG",MB_OK);
return FALSE;
}
//-------
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
step 2:
Thread method. This method waits for events to set. When event is set which signifies same application tried to start, this thread brings first instance in the foreground.
// COnlyOneApp message handlers
void ScreenMonitor(LPVOID pParam)
{
CWnd* wnd;
while(ShutDownFlag)
{
WaitForSingleObject (hEvent, INFINITE);
wnd = CWnd::FromHandlePermanent(static_cast<hwnd>(pParam));
if (wnd->IsIconic())
wnd->ShowWindow(SW_RESTORE);
wnd->SetForegroundWindow();
ResetEvent(hEvent);
}
}
It works fine. But I am worried about issues which I am not able to think like race condition,Uniqe event in system or higher speed system with single click execution.
Please let me know your concern.
regards,
-OP
Who lets the coder out...
|
|
|
|
|
Hi all,
I have used some of the synch objects in my code. At times I tried using more that one for same purpose, and both works fine..
Many books, docs explain about the synch objects..But I couldn't find about the analysis of When to use what kind of sych objects in detail..
Can someone who has a solid understanding on this can share their thoughts on this..or can give some pointers on When to use what synch objects..
Thanks,
|
|
|
|
|
|
Thanks Anyway..
But this discusses what each synch object is..
I am looking for info on distinguistion between each and other object with respect to a sample situation..
Let me know if you have more info on this..
Thanks,
|
|
|
|