|
Do you have ActiveSync installed ? It's been a long time I didn't do that but if I remember correctly, everything was working fine for me.
Which version of Visual Studio are you using ?
|
|
|
|
|
I am developing my application in eMbedded Visual C++ 4.0 and installed MICROSOFT ACTIVESYNC 4.5.
By the way my WIN CE device has a COM port wire and a USB wire which one shall i have to connect to my Desktop PC
I tried by connecting both of them , and then i got the "Timed out error message!!
Thanks!
|
|
|
|
|
Hi,
I have created MFC application.I am having 2 Dialog boxes.If I click "Add" button(push button) on first Dialog second dialog will open.After canceling of second dialog once again focus is coming on Add Button.At that time I need to refresh my list box,which is on first dialog.
I need to get focus of Add button.So I have created small program like this
BEGIN_MESSAGE_MAP(CMyThreadDlg, CDialog)
ON_BN_SETFOCUS(IDC_BUTTON2, &CMyThreadDlg::OnBnSetfocusButton2)
END_MESSAGE_MAP()
void CMyThreadDlg::OnBnSetfocusButton2()
{
MessageBox(_T("Focus"));
}
If I click on that button focus is coming but function is not calling.Can anyone help me.
|
|
|
|
|
Why do you need to refresh your listbox when your add button gets focus? I am just guessing but i believe what you want is to refresh your list when your second dialog is closed. If it is a modal dialog then all you need to do is refresh your list after your second dialog's DoModal returns.
void CMyThreadDlg::OnPressedAddButton()
{
CMySecondDialog Dlg(this);
Dlg.DoModal();
RefreshMyListNow();
}
If you insist on the focus change maybe try using ON_BN_SETFOCUS(IDC_BUTTON2, OnBnSetfocusButton2) instead of ON_BN_SETFOCUS(IDC_BUTTON2, &CMyThreadDlg::OnBnSetfocusButton2) , does that help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Thanks for your reply.I am calling refresh function after second dialog returns.
My code is working fine.
|
|
|
|
|
Hi,
i have a function which takes a parameter as LPCTSTR ie...
f1(LPCTSTR str)
{
ShellExecute(NULL, "open",str,NULL,NULL, SW_SHOWNORMAL)
}
The above function gives error like...
error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'
pls help me out..
|
|
|
|
|
Use
ShellExecute(NULL, _T("open"),str,NULL,NULL, SW_SHOWNORMAL)<br /> instead. I suggest you take a look at this article[^] to get a better understanding about strings manipulation and UNICODE (this explains why you have the error).
|
|
|
|
|
the given answer is correct.
But for the future you really need to understand the difference between these string types. LPCTSTR is a macro which resolves in ANSI in 1-byte chars BUT in UNICODE in 2-byte chars. At best you take a look at the byte layout in debugger.
If you dont consider this in your work you will have a lot of annoying bugs.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That's why I gave a link to an excellent article explaining all these things in detail
|
|
|
|
|
For future reference, the error you are receiving has nothing to do with f1() or its LPCTSTR parameter. The error has to do with the string literal being passed to ShellExecute() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
can anyone give me some link which clearly explains creating a modeless dialog box?
thanks in advance..
rakesh
|
|
|
|
|
|
|
Hi all
I have a simple change password utility that I wrote in Visual c++. It happily runs on Windows 2000, XP, and Windows 2003 sp1. Recently we upgraded to Windows 2003 sp2 and the program no longer works on that platform. It still works through XP sp2, Wind 2000 etc.
What happens is that a user will enter their username, domain name, old password and new password and this will change the password for that user. It always worked before but since Win2k3 sp2 it now retuens the error NERR_PasswordTooShort, indicating that the password does not meet complexity rules of the domain. Nothing was changed in relation to complexity rules. I had a server that was not upgraded to Win2k SP2 (still on SP1) and it worked a treat. The code snippet I use is below. Has anyone seen this issue?
Thanks fro any assistance
---------------------------code snippet-------------
nas = NetUserChangePassword(
wComputerName,
wUserName,
wOldPassword,
wNewPassword
);
if(nas != NERR_Success) {
switch ( nas ) {
case ERROR_ACCESS_DENIED:
AfxMessageBox("The user does not have access to the requested information.");
break;
case ERROR_INVALID_PASSWORD:
AfxMessageBox("The user has entered an invalid password in Old Password.");
break;
case NERR_InvalidComputer:
AfxMessageBox("The Computer name \\ Domain name is invalid.");
break;
case NERR_NotPrimary:
AfxMessageBox("The operation is allowed only on the primary domain controller of the domain.");
break;
case NERR_UserNotFound:
AfxMessageBox("The user name could not be found.");
break;
case NERR_PasswordTooShort :
AfxMessageBox("The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.");
break;
default:
AfxMessageBox("Password Change Not Successful");
}
|
|
|
|
|
I'm new in VC++ 2008.
i got a CAD file which is already convert into STL file.
how do i display it as a 3D image in MFC..
Wat knowledge should i must have to handle this task?
|
|
|
|
|
Using pure GDI, this will be very complex because GDI only draws 2D (so you'll need to make all the conversions from 3D to 2D yourself, which is probably not what you want). What you could do, is use OpenGL inside your MFC application to take care of the 3d drawing (or another graphic library like directX, but I think OpenGL is more suited to this task).
This is a rather complex task and it is impossible to answer in a single post, so my reply is a general guidelins so that you know a bit where to look. For a start, I would search for articles on CP that describes how to embedd OpenGL in an MFC application (I saw at least one such article) and then I would start to learn OpenGL. This[^] is an excellent book to learn everything you need. You can also find a free version of the book for previous version of OpenGL on the net (which are legal).
On the other hand, somebody perhaps wrote such a control to display an STL file, but I guess you already search for that on google and couldn't find anything. Apparently you didn't because after a very quick search, I found this[^]. You could go and take a look at the implementation. Maybe there are other articles on the subject also.
|
|
|
|
|
I want to draw a special show picture use gdi+
but there is some question
when i use Image image(L"PIC.JPG") to load a picture
in class view OnDraw() ,There is no question about link and build
but the pictue can't show and memory wrong with a messagebox
who can help me ?
dragon.tang007@gmail.com
|
|
|
|
|
Try like this:
Graphics graphics2(GetDC()->m_hDC);
GdiplusStartupInput gdiplusStartupInput2;
ULONG_PTR gdiplusToken2;
GdiplusStartup(&gdiplusToken2, &gdiplusStartupInput2, NULL);
Image image(L"c:\\33.bmp");
graphics2.DrawImage(&image, 100, 100);
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I want to control printers.
I make jobs pause .
SetJob(hPrinter,pJobStorage[i].JobId,2,(LPBYTE)(pJobStorage),JOB_CONTROL_PAUSE);
If the jobs is illegel,I delete it.
SetJob(hPrinter,pJobStorage[i].JobId,2,(LPBYTE)(pJobStorage),JOB_CONTROL_DELETE);
Else pass .
SetJob(hPrinter,pJobStorage[i].JobId,2,(LPBYTE)(pJobStorage),JOB_CONTROL_RESUME);
When it pass , SetJob() return 0 .
Value of "GetLastError()" function is 5. It means "Access is denied" .
And the jobs always pause .
How can I do .
|
|
|
|
|
All,
My program at any given time is writing up to 64 files to disk. The data is streaming in in an asynchronously to each of the files. I want to pre-allocate the space for each file on the disk to reduce file fragmentation. How do I do this?
Thanks in advance.
|
|
|
|
|
Use SetFilePointer[^] to set the file pointer to the desired file size, then SetEndOfFile[^] to actually resize the file, then SetFilePointer back to the start of the file?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Under Windows 7, the design of the tray notification area is different from Windows Vista and XP. It provides the settings of "Show icon and notification ", "Hide icon and notification ", and "Only show notification " for each icon. Except the system built-in icons set as "Show icon and notification ", all the other icons are set as "Only show notification " by default.
If a systray application is intended to launch with the property "Show icon and notification " programmatically, how to do that? Is it done by modifying some registry key? Or done by adding some flags in the source code?
Thanks!
Maxwell Chen
|
|
|
|
|
This page[^] says this:
There have been changes to the notification area that give the user much more control over what icons appear on the taskbar. All notification icons are now hidden by default and that visibility cannot be programmatically controlled. Only the user is allowed to choose which notification icons appear on the taskbar.
That makes sense to me...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you very much for your great information, Stuart!
Maxwell Chen
|
|
|
|
|
If I need to set this programatically using c#.
How can I do this????
(or even show a user a message box to remind him the option of displaying the icon and clicking ok will show the icon)
|
|
|
|