|
Hi all
Could someone help me how to change CHtmlView's rendering font by TTF. ( HTML file output font). I am trying SDI with CHtmlView.
I tried to change in OnCreate(); and OnInitialUpdate().. but could not succeed.
My main goal is detect windows-1251 character set and then render it by own TTF. It is very important for me.
Any tips any link will be great.
Thank you all
|
|
|
|
|
Hi!
I want to delete macro's from compound file.
No problem with word(doc) , pStorage->destroyElement().... L"Macros"....works fine.
But I have a problem with Excel, after deleting the macro storage (_VBA_PROJ..) the excel file fails to open.
I tried deleting streams ,but still other problems.
What should be done? Any suggestions?
Thanks Erez.
|
|
|
|
|
Macros often resolve in some code. So you must care to what this macro resolves.
It´s often not very funny.
|
|
|
|
|
I want to define a usermessage WM_USER_MESSAGE in my app. The message id's are UINT.
So, what is the minimumvalue we can use for this? I guess the windows messages have their own id's up to a certain value.
The lowest possible UINT for user messages? And the highest?
Tnx
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
use WM_USER + xx.
But i would rather use RegisterWindowMessage()
/Magnus
|
|
|
|
|
Tnx.
And what's the maximumvalue? WM_USER + 99?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I would prefer WM_USER + x ( x > 5 ) because its a constant and get compiled as value.
With Registerwindowmessage you have an API-Call with resoures ...
Exception: a complex program (multithread, multiple apps, instances)
|
|
|
|
|
If you are 100% sure that it will not collide, use WM_USER + x.
But just searching trough the windows headers reveals that WM_USER + x is used in tons of places already.
The overhead of the API call i wouldn't care much about in this case.
(you call it once)
/Magnus
|
|
|
|
|
So, it's the Wild West out there in WM-land
Do you mean that mfc already uses them, or just some thirth party libraries?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I mean windows already use them.
MFC i dont know about, maybe.
But since the messages go to the windows you send them to, you can
reuse the ID's.
..but anyway, better safe than sorry i think.
/Magnus
|
|
|
|
|
From MSDN
WM_USER
Range Meaning
0 through WM_USER – 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system for future use.
WM_APP
Range Meaning
0 through WM_USER – 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system for future use.
Look up WM_APP and WM_USER for more info
Michael
|
|
|
|
|
...Ok, so I don't have to bother about maximum values
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
How do you get the filename and path of an application's .exe?
I'd like to read and write files in my MFC application's directory, which is not always equivalent to the current working directory when it starts.
Thanks for your help.
|
|
|
|
|
GetModuleFileName(NULL) .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That was quick! Thanks, that's exactly what I was looking for.
|
|
|
|
|
Hi, We all know that we can set the minimum one milliseconds elapse time with SetTimer function. Can anyone tell me how to set less than 1 ms say 500 micro seconds?
|
|
|
|
|
Have a look at
http://www.codeproject.com/system/timers_intro.asp#MMTimers
|
|
|
|
|
You will want to look at QueryPerformanceCounter and QueryPerformanceFrequency . Most computers now have this high resolution timer, however some of the older ones do not. IN those cases you will have to rely on the Multimedia timer which has a resolution of 1 millisecond.
By the way, I believe the timer resolution on the system timer with WM_TIMER has a resolution of 55 milliseconds.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Is it S_OK to use W2A to convert from a BSTR to a const char * ?
Means, can I do this?
const char * p = W2A(bstrBlah);
Nish
p.s. I am doing this now and without any problem. But I just wanna know if it is safe!
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Yes, a BSTR holds Unicode characters, so W2A() is perfectly fine.
<nitpick>
Since you're assigning to a const char*, use W2CA() instead.
</nitpick>
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Michael Dunn wrote:
use W2CA() instead
Thanks Mike
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Dear All,
APPLICATION:
To run two processes simultaneously
Brief Description of Project
64 i/os are interfaced using 8 i/o modules that communicate with PC via RS232/RS485 converter. Modules are microcontroller based which give input data to PC coming from the machine and pass on the output data generated by the PC, back to the machine.
The code is written in VC++ and used multithreading for parallel process. The operation needs some TIMERS for wait process.
Following are the queries:
1 The process demands TIMERS are to be continuously monitored for elapsed time and saved in an .ini file format when thread is in running state. Can anyone suggest the right method of doing so?
2 Only two threads are being used. Here, we are using ‘SwitchToThread()’ function to switch the system resources between two processes. Is this the right method ?
Following is the brief code we have used:
CreateThread() T1 // in SDK DLL
{
Function1(); // To read the .ini file for process 1
{
SwitchToThread();
}
}
CreateThread() T2 // in SDK DLL
{
Function2(); // To read .ini file for process 2
{
SwitchToThread();
}
}
Please spare some time and give me your valuable suggestions.
|
|
|
|
|
I would use WaitforMultipleEvents -Stuff in addition to some timing events.
|
|
|
|
|
Hi
How can i transfer some binary data from one machine to
another. The two machines have a Modem (USB) and i want
to develop under VC++.
Please help
Sameer
|
|
|
|