|
(I'm new at VC++). I've been looking for an hour on how to do this. I am wondering could you give me an example of how I would do this? (I tried looking for things such as m_ListBox.SetStyle() but could not find anything?)
Thanks for the reply I do appreciate it!
|
|
|
|
|
See CWnd::GetStyle() and ::SetWindowLong() to dynamically change a control's style.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Close, CWnd::ModifyStyle() is the function to use (assuming you're using MFC which it looks like you are)
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, LBS_NOSEL );
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, LBS_MULTIPLESEL );
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, 0 );
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi,
Can anyone please give me a clue about changing the background color of a word in a CRichEditCtrl control?
I've seen the documentation on Rich Edit 2.0 (whereever that lives!) and CHARFORMAT2 but whenever I try it the background color remains unchanged.
BazM
|
|
|
|
|
Hello,
see this article,
http://www.codeguru.com/richedit/SyntaxColorizer.html
With Regards,
R.Selvm
------------------------------------------
Wish you happy new year!
|
|
|
|
|
Hi there and many thanks for your reply.
I had already read this article but I dont think it helps with changing the background colour of an individual word.
However, I just found a great article by Andrew Forget (CodeGuru) about Rich Edit 2 and I am hoping that this does the trick.
Have a happy and prosperous new year!
BazM
|
|
|
|
|
I wish to copy a string of text to the Windows clipboard and paste it from it to an edit control.
what is the process? i tried consulting with MSDN, however, i couldn't understand the process, and where exactly is the reference to the Edit's handle.
Can someone explain shortly how it works, and what are the steps to be performed?
|
|
|
|
|
One solution is via COleDataSource.
char sString[5] = "2004";
sString[4] = '\0';
HANDLE cbData = ::GlobalAlloc(GMEM_MOVEABLE, 5);
PTSTR pData = static_cast<ptstr>(::GlobalLock(cbData));
_tcscpy(pData, sString);
::GlobalUnlock(cbData);
COleDataSource *pODS = new COleDataSource;
pODS->CacheGlobalData(CF_TEXT, cbData);
pODS->SetClipboard();
Check out MSND.
Kuphryn
|
|
|
|
|
Hello !
I'm currently working on an DOS App but i don't know how to use colors. For e.g. I want to set the BK color on BLUE and the Text color on WHITE. And i don't know to how to draw borders. I didn't found any Articels about this.
|
|
|
|
|
Hello,
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut, FOREGROUND_RED);
With Regards,
R.Selvam
|
|
|
|
|
Thanks. Works great
|
|
|
|
|
*plonk*
what you mean is a Win32 Console Application, not a DOS App
scio me nihil scire
My OpenSource(zlib/libpng License) Engine:
http://sourceforge.net/projects/rendertech
Its incurable, its a Pentium division failure.
|
|
|
|
|
I want to write a virtual printer driver.
The driver should be used from any print-dialog like any other printer which is installed on the system.
It should get the pages to print, change them and give them to the "real" printer.
Probably someone knows how to write such a driver an how to give the data further to the "real" printer.
Is this possible with Visual C++ and MFC? And how to make it?
I hope someone can answer me because there are very few things on this topic on the internet.
shojo
|
|
|
|
|
I want to develop a application which will connect me directly to yahoo messenger window(or any desktop application). i.e entering username and password in Login window will be handled by my application.
Any suggestions?
|
|
|
|
|
It is only a wild guess
I would Install a System wide CBT Hook and wait for the creation of Yahoo Login window (will work definitly)
then as soon as the window is created Use SetWindowText to set the Text in the username window and Password (might work)
and then send the dialog a message for Button click (will work)
Hope it helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Till CBT hook I am clear.After that how to wait for yahoo login window. Situation is not clear to me rather idon't know how to do it
|
|
|
|
|
SiddharthAtw wrote:
After that how to wait for yahoo login window
Check for the creation of login window in CBT Hook procedure
Use the Classname of Login window.
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
I need to get all users information from my windows system.
not only the users from local domain
I want to be able to see users from other domains who have rigths on my machine to indentify the privileges.
I used NetEnumUsers API but this function return only users from local domain
Anyone can help?
|
|
|
|
|
One solution is NetUserEnum().
Kuphryn
|
|
|
|
|
hi everybody,
I am doing one C++ programming and facing some problems.
Linking...
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
matlabwizard.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
can anyone please help me to solve this problem?
thank you very much.
HAPPY NEW YEAR 2004 ~!
vincent sim
|
|
|
|
|
Hopefully you have done the following stuff
1) file->new->Win32 Application
Ans : use Win32 Console Application, this will solve your problem
if this is not the story, feel free to reply!!!
regards
Balkrishna Talele
|
|
|
|
|
Hi Everyone
This is very urgent. The problem which we are facing in our project is related to the floating point optimizations performed in VC++. The following code snippet elaborates this:
program main
double precision::a,b,x
a = 1.D0
b = 0.1
x = a/b
write(*,*) x
end program main
The above program construct in Fortran stores b as 0.100000001490116 & computes x as 9.99999985098839.
The same equivalent construct in C++ with double variables stores b as 0.10000000000 & computes x as 10.00000000000.However if we declare b as float we get similar results(but our project can’t use floats).
The difference in the results is attributed to the fact that C++ perhaps performs some optimizations to store values of type 1/10 1/100 etc.Hence gives expected results.
Our project requires similarity in results across Fortran & C++.Also we are only free to make changes in the C++ code.We have tried few things in this regard like /Op switch, _control87 & _controlfp.routines with different arguments but couldn’t resolve the problem.
What is required precisely is that the following code segment should assign x the value 9.99999985098839 & that too there should be some global setting sort of thing in VC environment as the code spans around 3 lakh lines which makes it difficult to make changes everywhere.
Void main(void)
{
double a,b,x;
a = 1.0;
b = 0.1
x = a/b;
}
Any help in this regard will be highly appreciated.
Thank you.
-apv
|
|
|
|
|
In C/C++ a float data type uses 4 bytes to store the number, and IIRC has an accuracy of 6 decimal points, so any digits after that are subject to inaccuracy. A double data type uses 8 bytes to store the number, and has an accuracy of 15 decimal points.
I would assume that the fortran code you are using is generating 4 byte floating point numbers, which is why you are getting the same inaccurate numbers as the float type is giving you.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
apv wrote:
floating point optimizations
In FORTRAN, that brings back memories!!! All I could suggest is look for a freeware maths library that defines it's own double "variable". I know there are lot's out there hopefully there will be one that will work for both FORTRAN and C and will give identical results.
But someone may come up with a compiler switch, but I doubt it. The other alternative is to work in long integers and convert to double at the end, but beware of overflows.
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
|
|
|
|
|
It's been about 20 years since I did FORTRAN, but I think that floating point literals (like 0.1) are single precision by default in FORTRAN but double precision in C/C++. This causes the difference in value of "b" and "x". There may be a compiler switch to change that.
|
|
|
|