|
I have created a 3D model and want to include a light source,
after I created it, the colour of the whole model changed to one colour...
moreover, the light source was not fixed in one position and changing all the time...
can anyone pls tell me how to fix this and provide me some examples??
thx very much~~
|
|
|
|
|
hi:
Recent there are some problems boring me ,which is how to read the CD_ROM sectors.As we all know ,there are three track mode. The first one is CD_DA ,which is Audio CD ,The second one is MODE1 ,the last one is CD_ROM XA ,which is MODE2 and has two form.
Now I can read the sectors which track mode is MODE1 or MODE2form1 with CreateFile and ReadFile API,but can't read other track modes with them. I want to read the sectors which track mode is ANY ONE with DeviceIOContrl and IOCTL_CDROM_RAW_READ,but I can't read anything.
This is my code.
hCD = CreateFile ("\\\\.\\H:", GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
lpSector = (unsigned char *)VirtualAlloc (NULL, dwSize,
MEM_COMMIT|MEM_RESERVE,
PAGE_READWRITE);
RAW_READ_INFO Info={0};
Info.DiskOffset.QuadPart=0;
Info.TrackMode=XAForm2;
//Info.TrackMode=YellowMode2;
//Info.TrackMode=CDDA;
Info.SectorCount=1;
DeviceIoControl(hCD,IOCTL_CDROM_RAW_READ,&Info,
sizeof(Info),lpSector,2352,&dwNotUsed,NULL);
Now the DeviceIoControl return 0,and there is no data in the lpSector
and my friend suggest me that I should use DeviceIOContrl and IOCTL_SCSI_PASS_THROUGH_DIRECT,but using them will bring a lot of questions
another question is how to differ the track mode.
Thank you very much
Regards
|
|
|
|
|
longdafeng wrote:
Now the DeviceIoControl return 0,and there is no data in the lpSector
Which means the function failed. What does GetLastError() return at that point?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
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...
|
|
|
|