|
I am not as familiar with VB or VBA for that matter as I used to be, so if you could give some details of what is actually being accomplished in that code block we may be able to help you.
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!
|
|
|
|
|
Hi,
Let say we have a List Box dialog (Visual C++ 6.0 MFC), with text on it (Tabs, spacing, linefeed ...)
Is there any way in programming (simple) that we can print out as it is (text & screen proportional) & easy to see?
a) If I use: m_listbox.GetClientRect(Rect);
m_listbox.Print(&printer, PRF_CLIENT);
*) I got what I see, but the text size is very tiny
b)If I use: m_listbox.GetItemText(i, j, str, 10);
k= strlen(str);
dc.TextOut(350*j, l+(75*i), str, k);
*) The text size is OK, but the printer printout Tabs as "square" symbols ang resulting the print out looks badly (not in-lines)
---> Any one can help? I thought that Visual C++ MFC is a very powerful application, this is supposed to be a simple task (print out as it is)!
*) If anyone wants that I send the whole (but very simple) program to see & modify to make it works better ... I am please to send my zip file to anyone!!!
It is a desperate request, thanks in-advance!
ATC
|
|
|
|
|
Hi,
I am trying to have a Timer in a non-window class(Generic Class). I need to call some non-static function in the class, from the Timer Procedure. As the Time Procedure is non-static I want to know what is the best to way to handle it? Is there an alternate way to create timers other than using "SetTimer" call?
Thanks
Arthi (Just a Begineer in VC++)
|
|
|
|
|
For normal timers, you need an HWND. I suggest that you create an invisible window to handle timer messages.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Hi,
Thanks for your suggestion. Does this mean that I cannot create timers for non-window classes and have them call functions in the class?
Thanks.
Arthi
|
|
|
|
|
arthivjii wrote:
Does this mean that I cannot create timers for non-window classes and have them call functions in the class?
For normal timers you need a window.
But you can take a look at Multimedia timers if you really don't want a window, even a hidden one. Multimedia timers are higher precision timers, but their usage is not as simple as that of normal WM_TIMER based timers
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Is there a way to add a vertical scroll to a static Text box?
Thank-you
Sincerely,
RAH
|
|
|
|
|
SnapRick wrote:
Is there a way to add a vertical scroll to a static Text box?
No, you cannot! Not normally anyway. But you can use a read-only edit box with much the same effect!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
I have never tried it, but in theory, as CStatic inherits from CWnd, you should be able to add scrollbars by setting the WS_HSCROLL and the WS_VSCROLL styles and then showing the scrollbars.
Just a thought.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Roger Allen wrote:
have never tried it, but in theory, as CStatic inherits from CWnd, you should be able to add scrollbars by setting the WS_HSCROLL and the WS_VSCROLL styles and then showing the scrollbars.
Just a thought.
Riga, I thought of that. But the static control seems to be a sort of disabled control in that it won't let ya select text and stuff I thought that also meant that even if we add scroll bars they'd also be disabled. Too lazy and tired to try it out now
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
How can I make a toolbar that will exist inside the taskbar, such as the address toolbar or the maginifier tool from powertoys?
im trying to make a simple program. id appreciate the help. thx.
|
|
|
|
|
Can anyone supply hints on how to convert twips to screen coordinates?
I believe this is dependent on screen resolution, but don't know where to start.
Ron
|
|
|
|
|
BlackDogEngineering wrote:
Can anyone supply hints on how to convert twips to screen coordinates?
See Q94927 - How to Convert Twips to Pixels
Nish
p.s. I think the sample code is Access 97 but you can convert to C++ easily I guess
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
I rembember when I was a baby and liked to play with the Visible Property in Visual Basic.
It was Button1.visible = TRUE, or FALSE.
I see that there is the same property in VC++ but how I can change it at runtime.
And how I can also change the enabled property, so that at some point in the program something is disabled, and after is enabled.
For example the Sign OUT button should be disabled, in I am not already logged in.
Thanks alot!
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
In VC++ you don't have 'properties'. Instead you have to call ShowWindow or EnableWindow.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
use m_Button1.ShowWindow(SW_HIDE) to hide it
use m_Button1.ShowWindow(SW_SHOW) to show it
|
|
|
|
|
hello (it's my first time here) <(:oD)!
i've implemented a server-app installed on machine01. afterwards i've implemented a client-app and installed it on machine02. usually the server-app is running on machine01, but if the app terminates i want to start it agein from machine02.
is this possible, without having installed any additional services to manipulate with rsh, rexec, at-dos-command aso...?
i would be very greateull fpr any hints!!!
thank you,
have a nice day,
ciao,
stefan
|
|
|
|
|
stefanb wrote:
is this possible, without having installed any additional services to manipulate with rsh, rexec, at-dos-command aso...?
If you are talking about Windows 95/98/Me, then no, I do not believe it is possible. This is because of security - it would mean that *any* user could run arbitrary programs on client machines!
If you are using Win NT/2000/XP, there are some indirect ways of doing it... like starting up services, etc., if you can log in to the machine as a user with the appropriate priveledges. If you can log on as administrator, you may be able to write your own service, copy it over, and start it up. But that's pretty complicated.
You might try checking for Windows vulnerabilities - there may be some buffer overflows or something you could take advantage of.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
stefanb wrote:
is this possible, without having installed any additional services
No.
Maybe you should look into a clustering (or even a simple load-balancing) solution? You could of course create something simple yourself by letting the server on machine2 ping (send "alive" packets) to the server on machine1. If the server on machine1 don't get these packets within a given time it would assume machine2 is dead and start serving the requests.
This would of course require the client application to either have a list of backup-servers to try, or initiate communications using multicast or broadcast.
|
|
|
|
|
hi,
how can i code such that all the messages recieved by a certain window is also recieved by any other window i wish.the other windows as well as the subject window are all created byhand?
also,where to put the stuff-to-be-put in OnCeate and other such functions in a hand coded control?
bye
|
|
|
|
|
What you say you want will not work, and I'm pretty sure you aren't really sure neither what you have requested nor what you want.
If you for some strange reason want to hang the app, you have to forward all Window messages to another window yourself. PostMessage and SendMessage. But, it will not work. If you're lucky you will just hang your app. If unlucky you will hit one of the bugs in the USER32 subsystem and hang the whole machine.
where to put the stuff-to-be-put in OnCeate and other such functions in a hand coded control?
OnCreate is just a handler for WM_CREATE. There are many examples of plain Win32 API programming in the SDK.
|
|
|
|
|
hi,
i am making a program ,to help my archealogist uncle in some research, to display some text in some ancient writings found in some inscriptions.i want to create new fonts for this purpose.
u c,this language has accent marks and also more importantly,the vowels and consonants unite to give a different symbol altogether-like the south east asian languages.
now how can i do that?i know Latin characters are easy to code-just use some font editor-but this type?
please help me.
|
|
|
|
|
If you just want this to be of limited scope, editing and displaying these character in your app, I think you're better off doing your own drawing and composing, and saving the data in your own specialized file format.
If you really want to create a font for this language, and generic ways to input this language using the keyboard, I think you'd have to both create a unicode font using a font editor - using only "free" unicode regions, possibly forcing you to use UCS-4/UTF-32 of which (AFAIK) Win32 has no support - and create some kind of IME (Input Method Editor).
The latter seems to me like an awful lot of work compared to do your own composing and drawing in a special app. Especially if you don't plan to release a Windows version localized to this language.
|
|
|
|
|
i have a listbox, and i added case-sensitive strings to it, like:
aA
AA
...
and when i click to AA, the selection moves to aA
i tried CListBoxCS, but as i understood the auther added only case-sensitive search to it... or maybe i dont understand something?...
please help me to solve this problem...
maybe i should use some other lists?
|
|
|
|
|
Hi all,
i want to change the Background Color of a Column.
this code gives me a Column Object of my Datagrid.
I can change the width of each coumn but how can i change the Bachground color?
CColumns cc = m_DataGrid1.GetColumns();
CColumn j0 = cc.GetItem(_variant_t( (long) 0));
thanks very much
|
|
|
|