|
ewighell wrote: #ifndef jjjjjjjjjjjjjjjjjjj
#define jjjjjjjjjjjjjjjjjjj
CString StrGlobal;
#endif
#ifndef jjjjjjjjjjjjjjjjjjj
#define jjjjjjjjjjjjjjjjjjj
extern CString StrGlobal;
#endif
ewighell wrote: #include "stdafx.h"
extern CString StrGlobal;
void fun()
{
StrGlobal = _T("KDKDK");
}
#include "stdafx.h"
CString StrGlobal;
void fun()
{
StrGlobal = _T("KDKDK");
}
Nibu thomas
Software Developer
|
|
|
|
|
For backup purpose Windows OS makes an Emergency Repair Disc(ERD) through Windows Backup Utility.In That
it makes a folder named RegBack, where it copies all registry values to files. I want to do the exactly same in my
program through VC++. Can anybody give me some direction please.I need help
nirmal
|
|
|
|
|
Hi
you can use the shellExecute for invoking the backup process from your VC++ apllication.
For windows Xp: you can call ShellExecute on rstrui.exe
For Windows 2000: you can call ShellExecute on ntbackup.exe
Cheers
"Peace of mind through Technology"
|
|
|
|
|
How does this help to copy registry keys/values to a file?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
See RegSaveKeyEx() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hello frnds,
I developed one application of video capturing.I used CCD Camera for this application and it display capturing window.now i want to draw a line on this capturing window but i could not draw line on it.when i run program first time it display line but when i start captuing th line disappear.I have attach the capture window on picture box.line show only after when i disconnect capturing(using capDriverDisconnect) from the capture window. if any one have solution plz send me.
The Following Code is for Attachment of Capturewindow with Picture Box.
void CSawingSystemView::OnCaptureStart()
{
// TODO: Add your command handler code here
HwndCapture = NULL;
GetDlgItem(IDC_MAIN_PICTURE_WINDOW,&hWndPicWind);//This is PictureBox Handle
::GetWindowRect(hWndPicWind,&PictureRect); //hWndPicWind is Global
capGetDriverDescription(1,DriverName,sizeof(DriverName),DriverVer,sizeof(DriverVer));
HwndCapture = capCreateCaptureWindow("Capture",WS_CAPTION|WS_VISIBLE | WS_CHILD,0,0,PictureRect.right,PictureRect.bottom,hWndPicWind,IDC_MAIN_PICTURE_WINDOW);
if(HwndCapture != NULL)
{
if(capDriverConnect(HwndCapture,1))
{
::SendMessage(HwndCapture,WM_CAP_GET_SEQUENCE_SETUP,sizeof(CapDriver),(LPARAM)(LPVOID)&CapDriver );
if( CapDriver.fHasDlgVideoDisplay == 0) AfxMessageBox("Not Support Video Dislplay");
if( CapDriver.fHasDlgVideoFormat == 0) AfxMessageBox("Not Support Video Format");
if( CapDriver.fHasDlgVideoSource == 0) AfxMessageBox("Not Support Video Source");
CAPTUREPARMS CapturePara;
double FramesPerSec;
FramesPerSec = 1000;
::SendMessage(HwndCapture,WM_CAP_GET_SEQUENCE_SETUP,sizeof(CapturePara),(LPARAM)(LPVOID)&CapturePara);
CapturePara.dwRequestMicroSecPerFrame = (1000000 / FramesPerSec);
::SendMessage(HwndCapture,WM_CAP_SET_SEQUENCE_SETUP,sizeof(CapturePara),(LPARAM)(LPVOID)&CapturePara);
if(!capPreviewScale(HwndCapture,true))
AfxMessageBox("Error in capPreviewScale");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_PREVIEW,FALSE,0)))
AfxMessageBox("Error in capPreview");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_OVERLAY,TRUE,0)))
AfxMessageBox("Error in capOverlay");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_PREVIEWRATE,1,0)))
AfxMessageBox("Error in capPreviewRate");
}
else
{
AfxMessageBox("Specified Capture Driver cannot be connected to the Capture Window");
}
}
else
{
AfxMessageBox("Error In Creation of CaptureWindow");
}
}
And in OnPaint I has code like this;
void CSawingSystemView::OnPaint()
{
CPaintDC dc(this); // device context for painting
int center_x,center_y;
CPen cPen,*cOldPen;
CWnd *cWndPicWnd;
cPen.CreatePen(PS_SOLID,1,RGB(255,255,0));
//CaptureWndHandle = GetDlgItem(IDC_MAIN_PICTURE_WINDOW);
CaptureWndDc = GetDlgItem(IDC_MAIN_PICTURE_WINDOW)->GetDC();
GetDlgItem(IDC_MAIN_PICTURE_WINDOW)->GetWindowRect(&PictureRect);
cOldPen = CaptureWndDc->SelectObject(&cPen);
center_x = (PictureRect.right - PictureRect.left)/2;
center_y = (PictureRect.bottom - PictureRect.top)/2;
if(CaptureWndDc != NULL)
{
CaptureWndDc->MoveTo(center_x - 10,center_y);
CaptureWndDc->LineTo(center_x + 10,center_y);
CaptureWndDc->MoveTo(center_x ,center_y - 10);
CaptureWndDc->LineTo(center_x ,center_y + 10);
}
}
ok............
|
|
|
|
|
hello frnds,
I developed one application of video capturing.I used CCD Camera for this application and it display capturing window.now i want to draw a line on this capturing window but i could not draw line on it.when i run program first time it display line but when i start captuing th line disappear.I have attach the capture window on picture box.line show only after when i disconnect capturing(using capDriverDisconnect) from the capture window. if any one have solution plz send me.
The Following Code is for Attachment of Capturewindow with Picture Box.
void CSawingSystemView::OnCaptureStart()
{
// TODO: Add your command handler code here
HwndCapture = NULL;
GetDlgItem(IDC_MAIN_PICTURE_WINDOW,&hWndPicWind);//This is PictureBox Handle
::GetWindowRect(hWndPicWind,&PictureRect); //hWndPicWind is Global
capGetDriverDescription(1,DriverName,sizeof(DriverName),DriverVer,sizeof(DriverVer));
HwndCapture = capCreateCaptureWindow("Capture",WS_CAPTION|WS_VISIBLE | WS_CHILD,0,0,PictureRect.right,PictureRect.bottom,hWndPicWind,IDC_MAIN_PICTURE_WINDOW);
if(HwndCapture != NULL)
{
if(capDriverConnect(HwndCapture,1))
{
::SendMessage(HwndCapture,WM_CAP_GET_SEQUENCE_SETUP,sizeof(CapDriver),(LPARAM)(LPVOID)&CapDriver );
if( CapDriver.fHasDlgVideoDisplay == 0) AfxMessageBox("Not Support Video Dislplay");
if( CapDriver.fHasDlgVideoFormat == 0) AfxMessageBox("Not Support Video Format");
if( CapDriver.fHasDlgVideoSource == 0) AfxMessageBox("Not Support Video Source");
CAPTUREPARMS CapturePara;
double FramesPerSec;
FramesPerSec = 1000;
::SendMessage(HwndCapture,WM_CAP_GET_SEQUENCE_SETUP,sizeof(CapturePara),(LPARAM)(LPVOID)&CapturePara);
CapturePara.dwRequestMicroSecPerFrame = (1000000 / FramesPerSec);
::SendMessage(HwndCapture,WM_CAP_SET_SEQUENCE_SETUP,sizeof(CapturePara),(LPARAM)(LPVOID)&CapturePara);
if(!capPreviewScale(HwndCapture,true))
AfxMessageBox("Error in capPreviewScale");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_PREVIEW,FALSE,0)))
AfxMessageBox("Error in capPreview");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_OVERLAY,TRUE,0)))
AfxMessageBox("Error in capOverlay");
if(!(::SendMessage(HwndCapture,WM_CAP_SET_PREVIEWRATE,1,0)))
AfxMessageBox("Error in capPreviewRate");
}
else
{
AfxMessageBox("Specified Capture Driver cannot be connected to the Capture Window");
}
}
else
{
AfxMessageBox("Error In Creation of CaptureWindow");
}
}
And in OnPaint I has code like this;
void CSawingSystemView::OnPaint()
{
CPaintDC dc(this); // device context for painting
int center_x,center_y;
CPen cPen,*cOldPen;
CWnd *cWndPicWnd;
cPen.CreatePen(PS_SOLID,1,RGB(255,255,0));
//CaptureWndHandle = GetDlgItem(IDC_MAIN_PICTURE_WINDOW);
CaptureWndDc = GetDlgItem(IDC_MAIN_PICTURE_WINDOW)->GetDC();
GetDlgItem(IDC_MAIN_PICTURE_WINDOW)->GetWindowRect(&PictureRect);
cOldPen = CaptureWndDc->SelectObject(&cPen);
center_x = (PictureRect.right - PictureRect.left)/2;
center_y = (PictureRect.bottom - PictureRect.top)/2;
if(CaptureWndDc != NULL)
{
CaptureWndDc->MoveTo(center_x - 10,center_y);
CaptureWndDc->LineTo(center_x + 10,center_y);
CaptureWndDc->MoveTo(center_x ,center_y - 10);
CaptureWndDc->LineTo(center_x ,center_y + 10);
}
}
ok............
|
|
|
|
|
I am writing one dialog based program. Now by default the "space bar" is doing the same things as the "enter key". I want the space bar to be disabled. Can you please tell me how to do that?
|
|
|
|
|
Handle the PreTranslateMessage of dialog class and write following code
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_SPACE)
{
pMsg->wParam=NULL ;
}
}
Regards
Amar Sutar
|
|
|
|
|
Its working fine. Thank you.
|
|
|
|
|
Plz check whehter u have the same effect even after u have changed the focus to some other controls in the dialog.
nave
|
|
|
|
|
You can override the PreTranslateMessage() method
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Hi dear friends,
Does anyone know how to use CORBA C++ Servers in .Net,
I use a poroxy dll for connecting to CORBA servers.
I want to port this proxy dll to managed, but I can not even compile it in VC 8.0
Please help me.
Thanks very much.
|
|
|
|
|
hello there, Have anybody worked with Opencv in .net? this library has a large amount of functions 4 computer vision and image processing, but it supports own type on image (i.e: IplImage), I want to convert this type of images to "bitmap"s in .net, please notify me if such a code exists.
Let's come together to know more!
|
|
|
|
|
|
Use Dependency walker to find out.
Nibu thomas
Software Developer
|
|
|
|
|
|
Microsoft introduced a new technology in VS2005, the embedded manifest (I don't know exactly what it is ). Because of that, it is not possible anymore to ship your external dll with your program.
Maybe this[^] article will help you. I didn't read it so I cannot guarantee that this will solve your problem.
|
|
|
|
|
hay ,
i tried to set up saveas command but instead of writing the full path of the file at the first variable in the command , i fill in the upper directory like this :
FullExcelReportPath="Reports\\";
book.SaveAs(COleVariant(FullExcelReportPath),
covOptional, covOptional, covOptional, covOptional,
covOptional, 1, covOptional, covOptional,
covOptional, covOptional, covOptional);
but it send me an error .
it work only if i'm writing the full path ("d:\\Reports")
how can i solve it?
eve
|
|
|
|
|
Hi,
Ive created a VC++ project that automates MS-Office applications. I want to convert it to a DLL so i can call the DLL frokm MATLAB 7. Is it possible to do a direct conversion or do i have to create the DLL from scratch. If anyone knows the steps/code please reply.
Thanks
E.S
|
|
|
|
|
this[^] may be of some help. There was a better guide to doing this on CP but I can't seem to find it at the moment.
|
|
|
|
|
I am using WMI in VC++. But there is to be a problem when i try to connect to a Remote Host . The machine I am trying to connect has Windows 2000 on it and I have Windows XP installed on my machine. Here is the code -
// Initialize Security
hrRetVal = CoInitializeSecurity(NULL,
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE,
0);
// CreateInstance
hrRetVal = CoCreateInstance(CLSID_WbemLocator,
NULL,
CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
IID_IWbemLocator,
(void **) &pWbemLocator);
BSTR bsNameSpace = SysAllocString(L"//impartials/root/cimv2");
BSTR bsUserName = SysAllocString(L"dchauhan");
BSTR bsPassword = SysAllocString(L"rajvada");
// Connect to the Server
hrRetVal = pWbemLocator->ConnectServer(bsNameSpace,
bsUserName,
bsPassword,
0,
NULL,
NULL,
0,
&pWbemServices);
// Query the Proxy Blanket for Authorization Level
hrRetVal = CoQueryProxyBlanket(pWbemServices,
NULL,
NULL,
NULL,
&dwAuthLevel,
NULL,
NULL,
NULL);
// Set the Proxy Blanket to the Authorization Level
hrRetVal = CoSetProxyBlanket(pWbemServices,
RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NAME,
NULL,
dwAuthLevel,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE);
// Execute Query
hrRetVal = pWbemServices->ExecQuery(L"WQL",
L"Select * from Win32_Service",
WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumObject);
Over here, i receive an Access Denied error. I am not getting what is the problem. Any help would be appreciated.
TobeyMag
|
|
|
|
|
How to remove all menus created by MFC APPWizard in MDI,
Both in MainFrame and ChildFrames.
In SDI,i we can add following code to the
MainFrame::PrecreateWindow()
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu); // delete menu if loaded
cs.hMenu = NULL; // no menu for this window
}
So,the menu is not created ,and we can't see the menu any more!
However ,when i add this code to the MDI application,the menus in Mainframe and childframes are still created!
any one who can tell me how to solve this problem?
this problem puzzled me for long time!
Thanks!
Brusaprk
|
|
|
|
|
Here[^]
Nibu thomas
Software Developer
|
|
|
|
|
HI joey Bloggs!
thank you for your reply!
i add the SetMenu(NULL).it works!@thank you very much,
but still has problems..
I add the micros to the ChildFrame as you metioned manually(there isn't WM_MDISETMENU message in my class wizard of VC6)as follow:
in the childfrm.cpp:
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
ON_MESSAGE(WM_MDISETMENU , OnMDISetMenu )
ON_MESSAGE(WM_MDIREFRESHMENU, OnMDIRefreshMenu)
END_MESSAGE_MAP()
and int the childfrm.h i add :
afx_msg void OnMDIRefreshMenu();
afx_msg void OnMDISetMenu();
but int the functions OnMDISetMenu() and OnMDIRefreshMenu(),it can't receive the message WM_MDISETMENU and WM_MDIREFRESHMENU!
could you explain it detailedly?
thanks a lot!
bruspark
|
|
|
|
|