|
GetLastError()return 0
but there is no data in the lpSector
|
|
|
|
|
You have something like:
if (DeviceIoControl(...) == FALSE)
DWORD dwError = GetLastError();
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hey all.
I am working on a dialog based app that has a menu in it. I've set some mnemonics on the buttons, such as "&Stop" and so on. When the program is run, the mnemonic shows up for the buttons perfectly fine ... ie Stop .... However, it is not doing this for the top menu. I created a menu, all it really has now is "&Options" and under that "&Configure". The only way I can get the mnemonic to show for the menu is by pressing the ALT key. As soon as I do that, the mnemonic shows up right away for the menus just fine.
If you are programming in VS .NET 2003, the IDE has the mnemonics for the menus showing at all times. I am wondering how that I can tell my menu to show the mnemonics all the time, not just when someone is pressing the ALT key. I've checked the menu properties and such but I can't seem to figure out how to do it.
Thanks!
|
|
|
|
|
I think it's a setting of your desktop. At least that's how it works for buttons and other dialog items. I can always see mnemonics for menus.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Usability bug in VS.NET - it's not following the user's preferences.
On Windows 2000 and XP, the default is not to show the underlines. If you want to turn this feature off on XP, right-click a blank area of your desktop and choose Properties, go to the Appearance tab and choose Effects. In the Effects dialog, uncheck Hide underlined characters for keyboard navigation until I press the Alt key.
To be fully compliant, you should hide your dialog mnemonics until you get a WM_CHANGEUISTATE message. Note that the Internet Options dialog in Internet Explorer does this (at least, for IE 6.0).
|
|
|
|
|
Get/SetCommState with its DCB structure should be enough, handling COMMCONFIG, COMMSTAT, COMMTIMEOUTS you can control almost everything on a serial port
|
|
|
|
|
But there is always a start bit and a stop bit present at the serial port. Is there a need to write in the "synchronosation clock" for synchronization purposes?
Actually my data is an analogue voice signals that has been convert to digital form using a PCM codec(hardware use with synchronisation). This digitised stream bits of "raw data" is to be received at the RS232 port.
Is there any alternatives to run a simulation test at the serial port to see whether it receive any "raw data", apart from using a signal generator?
|
|
|
|
|
Start and Stop bits, framing, and parity are all handled by the UART hardware; you don't need to be concerned about them other than to set your preferences at each end of the comm channel. Since hardware handshaking has gone out of style, serial comms are essentially asynchronous - you can't depend on port timing for real time use.
What you can do is set your sampling hardware to a defined sample rate less than the serial port rate, and buffer it in case there are delays that prevent a sample from being read by the host machine before the next sample is taken. I believe that modern uart chips have a built-in 16-byte buffer, and that may be adequate for your purposes.
On the host machine you can simply read the data continuously from the serial port and pass it to a buffer. A separate thread can read the buffer and process the PCM data.
For simulation purposes you might write a test program that uses COM1 to output a block of data at a slow rate, and COM2 to read data at a high rate, with a null modem cable between the two ports.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
the uart chips are not designed for these experiments, maybe you can read the bits on the parallel port (of course you must develop a specific driver)
|
|
|
|
|
Is there any refernces online as to how to go about doing parellel programming? How to find out about the register addresses and port addresses?
|
|
|
|
|
|
I use CPropertySheet create sheet and addpage,
but I want use CBmpButton to PostMessage to change page,
so I need hide tab label. But I don't know how to do that??
|
|
|
|
|
I am Starting 3d Game Programing.i am using C++. Do i need DirectX
If so where can i Get It.
Thank You
|
|
|
|
|
You have a choice between OpenGL and DirectX. Many game developers are using DirectX since it is currently providing better game support. Also, ATI's OpenGL drivers are not that good. You get better ATI support by using DirectX.
You should already have DirectX on your system. To program with the DirectX API, get the latest Platform SDK from Microsoft.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
|
Hi, I'm using a CEdit control as a Window that I can resize and move around, but I can't seem to place a Caption Title to it and places whatever I have on the text as a title (pretty ugly stuff!!)
Anyone knows what to do here?
Here's one of the windows:
CEdit m_wndTextSeg;
m_wndTextSeg.Create(ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | WS_OVERLAPPEDWINDOW | CLIPSIBLINGS, r,this,1);
Please... help!! thanks!!!
Jorge Lepervanche
-----------------
Carpe Diem!!!
|
|
|
|
|
A CEdit should normally be used as a child window, not a top-level window. Can you embed the CEdit in a dialog and set its (the dialog's) caption?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
you create a Static control and change the caption using SetWindowText().
With Regards,
R.SElvam
|
|
|
|
|
Hi.
I’m trying to create MDIChild from dll. I have a MDIExe project and MFCExtension dll. The dll have a MDIChild window and EXE will use that MDIChild. The Dll is responsible for the WindowPointer of MDIChild. In other word, memory allocation and creation of MDIChild arise on it.
To get Mainframe’s pointer properly the dll has some global exported functions and variables and Mainframe has set “this” pointer to dll. But whenever try to create it, WM_MDICREATE don’t processed…
On Mainframe’s OnCreate() I set self pointer to dll.
G_SetMainFrameWnd(this);
And call the dll’s creation function.
CCreator creator; - Exported class from the dll.
creator.CreateMDIWnd(1,1);
In createMDIWnd() below is happen.
AFX_MANAGE_STATE(AfxGetAppModuleState())
CMDIWnd *pWnd = new CMDIWnd;
pWnd->Create();
and
CMDIChildWnd::Create("TEST", _T(""), dwStyle, rectDefault, (CMDIFrameWnd*)G_GetMainFrameWnd());
And finally I can’t get hWnd from below line.
HWND hWnd = (HWND)::SendMessage(pParentWnd->m_hWndMDIClient,
WM_MDICREATE, 0, (LPARAM)&mcs);
Is there any missing point?
Thanks.
|
|
|
|
|
I'm writting an MFC Doc/View program which allows user loading DLL at runtime.
In the test DLL, I append a popup menu to the mainframe and it looks OK.
But the problems are,
if the ID number of added menu item is the same as that of existing menu item or toolbar button, selection on the added item will invoke the function of the existing one, not that of the DLL;
if the ID number of added menu item does not exist in mainframe before, the menu item will be disabled. Although we can use CFrameWnd::m_bAutoMenuEnable to do the trick, it's not good way, for all the menu items and button will be affected.
Looking into the wParam and lParam of WM_COMMAND message handler CMainFrame::OnCommand(), it's found that there's no difference between two menu items with the same ID number.
Any way to solve it? how does people add menu or toolbar button to MS Word?
|
|
|
|
|
THis article of mine provides an entire framework which does what you are trying to do:
MFC plug-in architecture[^]
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Yes, your frame solve the problem of route messages to addin dll.
There's another problem, just mentioned in your article, the unique ID number across EXE and DLL must be ensured.
But my application is only a platform EXE, and the DLL developers will be any other people, How could we ensure unique ID numbers?
|
|
|
|
|
I am trying to make a 3D desktop style program. Written in c++ and openGL. I need it to be displayed in a full screen window whilst still showing the start bar, I've managed to half achieve this using an overlapped window but it still has a frame and title bar round the window which I don't want. Anyone know how to do this? Secondly I need it to run behind all other windows at all times whether they are active or not, and I have had trouble finding out how to do this as well. Sorry if i've posted this in the wrong forum but I couldn't see any that were particularly relevant, i'm quite new to C++ and win 32 programming so finding it a strugggle and any help would be greatly appreciated.
Cheers.
|
|
|
|
|
I know that using SystemParametersInfo with the SPI_SETMENUSHOWDELAY parameter it is possible to adjust the time it takes for a sub menu to open when the mouse cursor is held over a submenu item. Even when the flags are set to not update the user profile or broadcast the change to other windows, this is still a system wide change. Any windows opened after a change is made will use the new settings until the current user logs off then back on.
I am looking for a way to adjust the menu show delay at the application level. Is there an easy way to accomplish this that I am not seeing?
|
|
|
|