|
|
pDC->SetTextColor(m_pLinesColor[i]);
pDC->TextOut(m_tempLT.x, m_tempLT.y-8, _T(m_pLinesName[i]));
why is not the setting color "m_pLinesColor[i]" in the print preview??
|
|
|
|
|
Have you tried to create a font, change the colour of the font attribute and use the pDC->SelectObject (&Font) instead of the pDC->SetTextColor ??
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hello people,I've installed Borlands' 5.0 C++
on a Windows ME machine running on a Vmware virtual disk.
The problem I'm having is this,at compile time I cant see the-
-out put of the file when it runs,instead all I see is a DOS like-
-box that briefly flashes on the screen.
I know that,that "box" is the out put,but how can I make it stay
on the screen long enough to see the results?
|
|
|
|
|
In C we use getch() function.
Величие не Бога может быть недооценена.
|
|
|
|
|
If he was running his application which was a "DOS" app, then yes, but he says he can't see the output from the compiler.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Assuming Borland's compiler runs as a Windows application, I would expect it to send its output to another Window/View. Have you checked all the configuration options?
|
|
|
|
|
I use getchar() -> #include <stdio.h>
|
|
|
|
|
Hi,
Is it possible to load a pdf file to a picture control?
Thanks
|
|
|
|
|
Hi i am using CListViewCtrl having 2 columns. I want to restrict column resizing withing CListViewCtrl . I have written the code like this
SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
But still it is allowing me to resize column width. I have also tried to avoid horizontal scrollbar (NO SCROLL == TRUE ).
Thanks in Advance,
|
|
|
|
|
Just refer this article [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
LVSCW_AUTOSIZE_USEHEADER is not going to prevent column resizing. It will resize column width to auto-fit header text.
To prevent header from resizing, handle HDN_ITEMCHANGING notificationin a your list view control.
You will have to tolerate cursor changing from arrow to resizing.
To be on the safe side, you will have to handle both versions of this code:
HDN_ITEMCHANGINGA and HDN_ITEMCHANGINGW.
Depending on the OS and IE versions, list view control is built as ANSI or UNICODE.
Always return 1 from a handler.
You can handle it differenly by deriving your own class from CHeaderCtrl and handle HDN_ITEMCHANGING notification from this class after subclassing List view’s header control.
You also will be able to get rid of resizing cursor using derived class.
Remember that you can handle HDN_ITEMCHANGING notification only in view or header, never in both, unless you want to go really wild.
Why are you trying to "avoid" scroll bar?
JohnCz
MS C++ MVP
|
|
|
|
|
Hi every body
I am using vc++6.0 My task is to convert an Audio file(Wav) into text not from Microphone.
e.g If I have "Hello there" store in wav file to it will transcribe it into text and show "Hello there" string on screen.
Any help in this regard will be highly appreciated. I am felt in tough deadlines. Any language code in preferred but priority is vc++.
thanks in advance
|
|
|
|
|
For that purpose i prefer you to install and check with SAPI ,
It has the option for speech recognition.
So i believe SAPI'S are reading the streams from microphone to a wav file and then processing it for performance.
Just have a try with that, all the best [^]
Величие не Бога может быть недооценена.
modified on Wednesday, November 25, 2009 7:20 AM
|
|
|
|
|
A wave file has sound encoded in it and not the string.
If you and I say "Hello there" and save them as 2 separate wave files, the files will be different.
So you will anyway have to play it back before converting it to text.
Also, this kind of conversion will need a very advanced speech engine very similar to http://www.nuance.com/naturallyspeaking.
Again 100% accuracy cannot be achieved.
|
|
|
|
|
Hi,
I've created a class containing a virtual function. Using pointer, I want to replace virtual function with a global function, but it gives memory access violation. So my question is that
whether it is possible to replace virtual function with global function?
How can we achieve this?
Please note that I am new to C++ and using MS VC++.
Here is the code...
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef void(*Fun)();
void f(void *pThis)
{
printf("other function\n");
}
class Test {
public:
virtual void fn() {
cout << "I m virtaul fn" << endl;
}
virtual ~Test() {}
};
int main() {
Test obj;
Fun pFun = (Fun)*(int*)*(int*)(&obj);
pFun();
//replacing virtual function.
int *pInt = (int*)&obj;
*(int*)*pInt = (int)f; // gives memory voilation
pFun = (Fun)(int*)*(int*)*(int*)(&obj);
pFun();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Thank you
|
|
|
|
|
Why do you want to do something like that ? It doesn't make any sense...
|
|
|
|
|
If you want to use global functions, then why you got hang up with virtual functions.
Global function and virtual functions are two different entities in programming, what the need do such a replacement.
Just define more so that we can understand what really want to achieve.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
First of all, I don't have any specific need. This is for the sake of curiosity. I just want to know - is it possible? Can we do in this way? If yes, then how? My code gives access violation, however, I am replacing correct address with correct address. What is the problem?
|
|
|
|
|
One of your casts is likely failing and returning a null pointer. Improper casts create difficult to track down memory errors in large systems.
//For instance C++ will let you cast an integer to an enum.
enum_X x=(enum_X) y;
If the value cannot be casted, you will get a memory error. You are lucky if you actually get an error message so that you can see the problem.
You should not try casting types where the conversion is not defined unless you want to spend many unnecessary hours debugging.
|
|
|
|
|
You cannot replace a virtual function in code like this, as it has the potential to compromise your app and so you are prevented from doing so. If you want a function pointer you need to create a global or local one and use that as necessary. I don't know what you are trying to achieve in your main() function but the code looks a total mess; I'm surprised it even compiles.
|
|
|
|
|
abhay4u wrote: Please note that I am new to C++ and using MS VC++
Then take your time to familiarize with them, and please note, the aim of programming is not fooling the compiler...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It's not possible if the compiler/linker are correctly putting vtables into sections marked as read-only.
I suppose Detours[^] might be able to do something. But why on earth do you want to do such a thing?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you very much guys. I got the answer.
|
|
|
|
|
Hello everybody !
Now I want to add the proxy module in a dialog based program,just like the Microsoft's MSN,you can set the network environment.I search it anywhere,but never konw how to set username and password :
I used stuct INTERNET_PROXY_INFO, could set the IP Address and Port:
INTERNET_PROXY_INFO proxy;
proxy.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxy.lpszProxy = m_strIPAndPort;
proxy.lpszProxyBypass = NULL;
But in the MSDN, there is no more information about the parameter of "lpszProxyBypass":
How to use the parameter "lpszProxyByPass" to set the proxy username and password ?
Thanks for your reply !
Best Reguard !
|
|
|
|