|
What do I need to create/compile a _UNICODE MFC application on Win 9x ?
Can some one tell me what files do I need to do this ?
Can some one tell me if a non-unicode application can be run on WinNT ?
Help me ...
Send me an answer as quickly as possible ...
|
|
|
|
|
Chris Maunder has a nice article on how to write Unicode apps called Unicode, MBCS and Generic text mappings[^].
As for the second question, yes, any non-Unicode app will run fine in NT (as a matter of fact, most apps are not Unicode!).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you very much ...
Stefan-Mihai MOGA
mogamihai@home.ro
|
|
|
|
|
My CFormView MFC MDI app needs to know the CREct of the total space occupied by my form. The UI first comes up with scrollbars on the frame, so my form is larger than the CformView form.
Thanks,
ns
|
|
|
|
|
This is not an answer to your question, but I guess it might help: inserting
GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);
by the end of the OnInitialUpdate method of your CFormView -derived class will instruct the whole UI to accomodate to the size of the form, so that no scrollbars appear.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Good try. But it didnt resize the CFormView or the mainframe. It may be a side effect of things I am doing (which I need to do). I have this function:
void CMainFrame::CenterMDIChildWindow(CMDIChildWnd *pWndToCenter)
{
ASSERT(::IsWindow(pWndToCenter->GetSafeHwnd()));
ASSERT(::IsWindow(m_hWndMDIClient));
CWnd* pMDICLIENT = CWnd::FromHandle(m_hWndMDIClient);
if (pMDICLIENT == NULL)
return;
CRect rcChild;
pWndToCenter->GetWindowRect(&rcChild);
CRect rcCenter;
pMDICLIENT->GetClientRect(&rcCenter);
int xLeft =0;
int yTop=0;
pWndToCenter->SetWindowPos(NULL, xLeft, yTop, rcCenter.Width(), rcCenter.Height() ,
SWP_NOZORDER | SWP_NOACTIVATE);
}
which I call as:
pMainFrame->CenterMDIChildWindow(pFrame);
that makes it fit the mainframe.
|
|
|
|
|
Well, I think you should try harder on the ResizeParentToFit path, but anyway. For CScrollView -derived classes (like form views themselves), maybe CScrollView::GetTotalSize is of some use.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
GetTotalSize was exactly what I needed. Now things fit!
Appreciate it!
ns
|
|
|
|
|
My program doesnt like it if you close the CFileDialog Open folder with the right cross menu . I looked at the m_ofn structure but didnt see anything that will suppress this menu. I only want the user to cancel or IDOK.
Any ideas?
Thanks,
ns
|
|
|
|
|
|
I think thats right - have to triple check it. I was doing something in ID_CANCEL that was making it behave inappropriately, and I thought it was a result of the system menu, but it was my fault I think.
Thanks,
ns
|
|
|
|
|
I have externed a structure from one dialog window to another and have used the debugger to check the values. That seems fine as far as the debugger is concerend, but when I assign one of the floats to a local float it is alway zero.
Is there possibly a compiler option or something that may be limiting my scope on the extern such that the debugger sees one thing and my program is seeing another. I just don't get it I have tried and tested everything I can think of.
|
|
|
|
|
try passing a pointer of ur struct, did that?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I gave that a try, same thing.
Is it possible to send a pointer from one dialog window to another?
|
|
|
|
|
I have included an header in my project in which are listed some function headers... eg:
[code]////////////////
// NGNBASIC.H //
////////////////
#ifndef NGNBASIC_H
#define NGNBASIC_H
float ngn_sign(float f);
float ngn_rad2deg(float radiant);
float ngn_deg2rad(float degrees);
#endif[/code]
I espect that these function appear under the "globals" labed in Class View, but this doesn't happen... instead, in another workspace where I work to produce the lib owned by that header, they are listed. What am I doing wrong?
Thanks in advance for your time.
|
|
|
|
|
Under globals only appear those functions that are actually defined in a .c or .cpp file included in the project, i.e. those who are provided by libs do not count (Otherwise, the whole MFC and Win32 API would appear in the classview!).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ah, thanks
is there no way to let class view to display them? Class interfaces are displayed, and I supply only .h files for them (implementation reside in .libs).
|
|
|
|
|
You could write dummy functions that fool ClassView into thinking your project implements them, but that the compiler ignores. Put the functions in some cpp file and wrap them like this:
#ifdef _SOME_DEFINE_THAT_IS_NEVER_DEFINED_
float ngn_sign(float f)
{
}
#endif // #ifdef _SOME_DEFINE_THAT_IS_NEVER_DEFINED_
</code>
ClassView will now show them under Globals, because ClassView doesn't care about preprocessor directives like that. The compiler does, of course, and that code will never be included so long as you don't actually define the tag.
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks for the trick
|
|
|
|
|
I have an application that runs under Win2K Pro and needs to disable the network card temporarily (I need to have as close to real-time response as possible and I don't want the CPU interrupted to deal with network activity). I can ask the user to go to the control panel and disable the network card, but is there a way to do this programmatically?
Thanks for any advice.
|
|
|
|
|
hav an idea, u can try it: surely the control panel is setting some entry in the registry to false or something like that, so all u need is try to know that entry.
If this ever exists, (hope it does) u can spy it using RegMon tool on the www.sysinternals.com
Hope this help
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
While not an answer to your question, have you looked at maybe using CreateProcess() to start your app in REALTIME mode? This will give you the highest possible priority, above nearly everything else, without having to disable other processes or drivers. You could write a little proxy application whose sole job is to launch your actual app by calling CreateProcess() with a creation flag of REALTIME_PRIORITY_CLASS.
Just a word of caution, of course... if you do it this way you will have priority above even disk I/O. Like the friendly manual states, if your process runs for more than a very brief interval, you can "cause disk caches not to flush or cause the mouse to be unresponsive."
If REALTIME is too much, there are also HIGH_PRIORITY_CLASS and ABOVE_NORMAL_PRIORITY_CLASS (Win2000) flags that are not quite as severe, but still preempt normal apps. Just take a gander at the CreateProcess() docs.
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks for the thought. I have indeed been experimenting with this with some success. However, it's also a good thing to turn off sources of hardware interrupts that I would just as soon avoid. I deal with the disk I/O problem by using a gigabyte of RAM, locking pages in memory, and avoiding any file I/O until the acquisition is complete.
Since I only need this priority level for a small portion of my application's running time, I use SetPriorityClass() rather than CreateProcess() .
I am trying to capture 5000 frames per second from a high-speed camera, so I am trying to avoid even an occasional millisecond of latency.
I would really like to work with an RTOS, such as QNX, but the frame grabber board I must use only has drivers for Windows.
|
|
|
|
|
I did a quick google search and came up with a few things that might help. Someone mentioned that there's a sample in the Windows DDK, under NTDDK\src\general\setup\Enable. Whether that has disable code or not, I'm not sure
More interestingly, there's an external program named DevCon that might do the trick, and apparently Microsoft gives out the source code in their latest XP DDK:
DevCon.exe KB Q311272[^]
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks a million! Those pointers help me with exactly what I need. For the moment, calling DevCon from my application should do just what I need. Sometime later, I can see about incorporating the DDK code into my application's core.
Thanks so much for pointing me an answer.
|
|
|
|