|
no i cant find it if you can pleas say to me
|
|
|
|
|
i ask it in eclipse.org forum and this is the answer:
"
printf("insert a");
fflush(stdout);
scanf("%d",&a);
|
|
|
|
|
What about:
printf("insert a: \n");
scanf("%d", &a);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
printf("insert a");
fflush(stdout);
scanf("%d",&a);
just this code work.and solve the problem
|
|
|
|
|
Dear Community,
I'm using C++ to develop a small Bootstrapper (Setup.exe) application in C++. Using CreateProcess() to launch a .hta (HTML Application) which is used as a UI. It then calls other installers one by one which includes *.exe, *.msi etc.
What I'm trying to do is if I execute my Setup.exe, it asked for UAC for once and launch .hta so that it doesn't required UAC any further. Here is my code:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
if( CreateProcess(NULL, "C:\\Windows\\MsHta.exe SetupGUI.hta" ,
NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
{
WaitForSingleObject(pi.hProcess, INFINITE );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
I actually saw same in an application installer, but I don't have its Setup.exe's source code.
Thanks a lot.
Farrukh
|
|
|
|
|
I think it is nothing to do with how you call CreateProcess. If your main application Setup.exe is launched in elevated mode, all processes lunched by this application will be launched in elevated mode.
In order to have an elevated prompt for your Setup.exe, you need to create manifest.
This simple manifest will trigger the UAC prompt for your application:
="1.0"="UTF-8"="yes"
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedPrivileges>
<ms_asmv2:requestedExecutionLevel level="requireAdministrator" uiAccess="false">
</ms_asmv2:requestedExecutionLevel>
</ms_asmv2:requestedPrivileges>
</ms_asmv2:security>
</ms_asmv2:trustInfo>
</assembly>
|
|
|
|
|
Visual Studio C++ provides facility for using ActiveX control in VC6.0 as well as in VC2010. I tried NTGraph3D activeX Control in VC6.0. It is working perfectly.
I tried the same in VC 2010. So for Visual Studio 2010, NTGraph3D ActiveX Control is not working.
So can anyone help me to solve this problem. Is there any change in properties ?
|
|
|
|
|
|
Hi,
How to get a ip address from system name and how to get a system name from ip address. below see my requirement.
input: 127.0.0.1
output: comp01
input: comp01
output: 127.0.0.1
Thanks
modified 23-Nov-12 4:54am.
|
|
|
|
|
|
Here is how to get ip address from system name:
|
|
|
|
|
Hi,
i need some help to solve this problem after create of worker thread.
When i create a worker thread i receive this error message:
Windows has triggered a breakpoint in myprog.exe.
This may be due to a corruption of the heap, which indicates a bug in myprog.exe or any of the DLLs it has loaded.
This is the code snippet:
CWinThread* cmythr= AfxBeginThread(controlfunc,params, THREAD_PRIORITY_HIGHEST, 0,CREATE_SUSPENDED,0);
if(NULL != cmythr)
{
cmythr->ResumeThread();
}
but after maybe 10 seconds i receive this error message:
and the debugger show in this code in the file thrdcore.cpp:
DWORD nResult = 0;
if (pThread->m_pfnThreadProc != NULL)
{
nResult = (*pThread->m_pfnThreadProc)(pThread->m_pThreadParams);
ASSERT_VALID(pThread);
}
A thing what make me confuse is that i cant find this position with memory allocation, i do nothing like this in this Function?
No parameter is NULL, what i'm doing wrong?
Any help is welcome
Thanks
bosfan
|
|
|
|
|
Answer these two questions.
1) Provide the prototype of your function controlfunc>
2) What do you pass as params?
|
|
|
|
|
It's impossible to guess what may be wrong with the information you provided. You should use your debugger to set some breakpoints in your code, and check the actual values of the various parameters at the time of the failure. You can also use the stacktrace to see which functions have been called recently.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
thanks for reply i try to solve this in this way.
best regards
bosfan
|
|
|
|
|
Could be wrong here but I think you have to call a Macro just after the thread enters in order to set it up properly, google it, it is well known. (Had this years ago, and havent done any user mode for ages. )
|
|
|
|
|
Try enabling the "page heap" for your application. It can be a little painful but it often finds the cause of problems like yours.
Steve
|
|
|
|
|
What are the steps required, i will connect to the SQL named instance server using the "CDatabase::OpenEx" by using the DNS Name?
i am already able to connect the SQL Server using the ip_address, Now i want to connect the SQL Server named instance by using Domain Name system name.
Can any one knows , kindly provide the solutions.
thanks,
lucky.
|
|
|
|
|
There is no difference, as long as the name can be resolved to the correct IP address.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello Friends
I am creating a win32 based application. Creating A Dialog with TabControl and Buttons using BS_OWNERDRAW as i want to set the color of button.
On WM_DRAWITEM, I implemented a function to set the color of button[ by getting all dc and rect of button and then fillrect).
So,when I open the Dialog, it is showing Initial Color Fine.
Now,I want to change the colors of button when I change the Tab. But,I am not able to find the Event or same WM_DRAWITEM will change button color on changing tab.
So,On Tab change,button colors remain same. How can I change the button color on Tab change.
Thanks & Regards
Yogesh
|
|
|
|
|
The right message (to handle) for changing button's color is WM_CTLCOLORBTN
|
|
|
|
|
But when this message(WM_CTLCOLORBTN) will be called ?
How can I handle this ?
Need little explanation.
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
It will be sent to the parent window (in your case the dialog) just before the button is painted. So handle it in your dialog's DlgProc function by creating a brush in the background color that you want, casting it to BOOL and returning it. See MSDN for details.
http://msdn.microsoft.com/en-us/library/aa930774.aspx[^]
|
|
|
|
|
I took HBRUSH as Global variable and then how it will be responsible for drawing all buttons and with different color.
Here is WM_DRAWITEM:
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpDrawItemStruct = (DRAWITEMSTRUCT*)lParam;
switch (lpDrawItemStruct->itemAction)
{
case ODA_DRAWENTIRE:
case ODA_SELECT:
{
int ndxColor = 0 ;
switch (lpDrawItemStruct->CtlID)
{
case IDC_btnPantone1 : ndxColor = 0 ; break ;
case IDC_btnPantone2 : ndxColor = 1 ; break ;
case IDC_btnPantone3 : ndxColor = 2 ; break ;
case IDC_btnPantone4 : ndxColor = 3 ; break ;
case IDC_btnPantone5 : ndxColor = 4 ; break ;
case IDC_btnPantone6 : ndxColor = 5 ; break ;
case IDC_btnPantone7 : ndxColor = 6 ; break ;
default : break ;
}
switch (lpDrawItemStruct->CtlID)
{
case IDC_btnPantone1 :
case IDC_btnPantone2 :
case IDC_btnPantone3 :
case IDC_btnPantone4 :
case IDC_btnPantone5 :
case IDC_btnPantone6 :
case IDC_btnPantone7 :
DrawButtonColor (ndxColor, lpDrawItemStruct) ;
break ;
default : break ;
}
}
default:
return DefWindowProc (hwndDlg, msg, wParam, lParam);
break;
break;
}
return TRUE;
}
case WM_CTLCOLORBTN :
{
SetBkColor((HDC)wParam, RGB(0,0,255));
return (BOOL)g_hBrush;
}
it is not changing .
Or m wrong somewhere ?
|
|
|
|
|
No need to use SetBkColor(). Windows uses the returned brush to paint the background.
Check the color used for g_hBrush.
|
|
|
|