|
yes, that works when you know the name of the control.
I apologise if the question wasn't clear. (blame it on my english, not me )
But suppose, i want to use the code for every dialog.
So i need to know the names of the controls dynamicaly.
And get all captions (GetWindowText()) of all static controls.
Greetings
Jens
|
|
|
|
|
Create a member variable for each of your control, so if you have several dialogs, you can still reach each control. For exemple, with a CEdit :
CString bla;
CDialog m_DialogNumber1(ID_DIALOG1);
CDialog m_DialogNumber2(ID_DIALOG2);
m_DialogNumber1.Create(...);
m_DialogNumber2.Create(...);
m_DialogNumber1.m_EditCtrl.GetWindowText(bla);
m_DialogNumber2.m_EditCtrl.GetWindowText(bla);
This example sucks, but i think you'll get the idea.
~RaGE();
|
|
|
|
|
well, i needed to get the WindowText of some controls. You can assign a member variable to it.
But the idea was not to do anything special, but just getting some kind of collection of all resources in the form. Then i would get that collection, check the type of resource (button, ...)
Why do i want to achieve this:
The program runs in about 3 languages. For easy translation, i want to be able to get all 3 translations of the text that is on the button for example.
Of course, i can type it over .. but because i'm a bit lazy it's alot of work.
I thought it would be easier to programmicaly do this.
Greetings
Jens
|
|
|
|
|
Use EnumChildWindows() and then GetWindowLong( hWnd, GWL_STYLE ) and GetClassName( .. ) to work out what type a control is.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hello,
I need to implement a chart control (from custom control) that will display real time data (I receive a point every 13 msec), in a normal line mode (e.g. something like an oscilloscope).
But I'm really really new to "graphical programmation". I found some examples here and I based my work on them (using memory bitmap we draw in, then "push" it to the display). I draw just once the "background" of the object (axes, grid, ...) on a bitmap and when I need to plot a new point, I add it to the bitmap.
I was wondering if this method will support high speed ?? If not, what can I do for it ?? A better solution is perhaps to invalidate just the region from the old point to the new point ??
Just a last thing to say: I program in embedded visual C++ (so for Pocket PC, ...) but I posted my question here cause the language is almost the same (some functions are not in embedded) and there's much more people oon this forum ! So, that's also a reasoon why I want to do it myself: I didn't found any chart that fits my needs!
All suggestions are welcome (as I said before, I'm newbie in this domain).
Thanks
|
|
|
|
|
For my application i used the CGraph Class from Brian Converey (http://home.attbi.com/~bconvery3/dev/cgraph4.html). But I must modified it for draw real time data. I can send you my changed code. Send me an email.
|
|
|
|
|
Hi !
Thanks for your help. You can send that on: cedric_moonen@hotmail.com
|
|
|
|
|
hi Cpians,
I just need a small help..
I need to create a modeless Message Box..
Any idea or help in creating this...
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Create a modeless CDialog with an Static ctrl and a button.
~RaGE();
|
|
|
|
|
I am accessing Files, folders, drives over network. Through SHBrowseForFolder I get the path over network. The problem arises when I check the path for validity with CFileFind.
Assume that there is a pc with name PCabc over the network, and it has a folder in one of it's drive with name FOLDER1, which is sharable, with the same name.
The path I recieve is \\PCabc\FOLDER1, Now when I pass it through CFileFind::FindFile() and CFileFind::FindNextFile(), the path is rejected. However if I take a folder say SUBFOLDER1 in the share FOLDER1 (which is also the exact name of the folder), I get no problem, ie, the path \\PCabc\FOLDER1\SUBFOLDER1 gives me no errors. It is accepted by CFileFind.
Can you suggest me what should I do to get the path for the shares which will be accepted by CFileFind.
Thanks
|
|
|
|
|
CFileFind::FindFile("\\\\PCabc\\FOLDER1\\*.*", ...); should work. If not, you'll need to step through the FindFile() code to see what it does not like.
|
|
|
|
|
My activeX for IE is request to connect the database through Internet. Can you help me?
stanley
|
|
|
|
|
Well, some of your choices are as follows:
1) Expose the SQL server to the internet and connect via the IPAddress as usual (Security NIGHTMARE)
2) Use RemoteDataAccess (requires IIS server and code changes)
3) Write your own Web server service that will authenticate the client and pass the SQL Statements on to the database behind the firewall.
4) VPN.
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
Hi all,
I guess this question will be easy for the windows expert on the CP, but I'm stuck with it.
Basically I enumerated all the processes on the system with PSAPI.dll's EnumProcesses.
Now from each process's HANDLE, I'd like to get a handle to its main window's HWND, in order to send messages using SendMessage.
How can I do that?
Thanks in advance,
Arnaud
|
|
|
|
|
One solution is OpenProcess(). Is one a reference from MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/enumerating_all_processes.asp
Kuphryn
|
|
|
|
|
Hi everyone,
I'm pretty new to multimedia programming, have a task here that need expert guidance from you all .
What I'm trying to do is to embed a mpeg 4 player into a MFC program I'm doing.
I'm pretty lost as to how to get started, I've read that DirectX is pretty useful for multimedia application in VC++. Should I focus on DirectX? Does it support Mpeg 4?
Thanks in advance.
Sincerely yours.
WT
|
|
|
|
|
bankman wrote:
Should I focus on DirectX? Does it support Mpeg 4?
Probably not and No. I would do a search for ActiveX controls that serve that purpose. There are a couple of direct show media applications that will play your format provided you install a mpeg4 codec. A quick search on the internet and I found one at http://ffmpeg.sourceforge.net/[^]
John
|
|
|
|
|
yes, i'm agreed the above's suggestion, but here
i'll give you suggestion that you should learn the
skills and technologies that were existed from current
all around world resources, so we all shoule learn 'get something'
behaviour to build our other more important projections,
these are bricks!!
|
|
|
|
|
I've created MFC application with Doc/View support. My view class is inherited from CRichEditView class.
I need to obtain the row and column number of the current cursor position.
The following function gets the current line number.
GetRichEditCtrl().LineFromChar(-1);
The question is "How can I get the column number"?
The ideal example is the Visual C++ IDE that shows the row and column of the cursor in the status bar. The row and column updates whenever the cursor changes.
|
|
|
|
|
A quite complicated solution :
Use GetSel to retrieve the caracter number.
Make a loop on LineFromChar with parameter the character number, which you decrement until LineFromChar changes.
Then, the first number minus the final one should give you the pos.
long int i,j;
m_RichEditCtrl.GetSel(&i,&j);
i=(i<j?i:j);
long int counter=m_RichEditCtrl.LineFromChar(-1);
while(m_RichEditCtrl.LineFromChar(i)==counter)
i--;
long int pos=counter-i;
~RaGE();
|
|
|
|
|
Got used that Microsoft Word underlines the errors in red?
Nice isn't it?
Well, when editing my C programs, the editor didn't do that. What a bore.
So, I decided to add that feature to the editor. It is very simple:
After some period of time has elapsed since the last key was pressed, save the text in a temporary file, and call the compiler to compile that file. Save the output of the compiler and parse it.
Do messages like "undefined symbol "xxx" appear?
If yes, store the line and position of the offending symbol, and when that line is displayed in the editor, underline the symbol with red.
Want to see it in action?
Download the editor with the associated compiler (no charge, no registration, no questionnaire to fill, no popups) from:
http://www.cs.virginia.edu:/~lcc-win32
It is a nice feature, that doesn't hide the fact that it is not Visual Studio of course. Maybe because of its small size this algorithm is at all doable. The compiler is small and very fast. So fast that can be used as a background compiler, running most of the time behind you when you type.
Is C outmoded?
Yes, of course. C will be always outmoded because it is not fashionable. As languages come and go away, C remains. If you write in C there is a bigger chance that your code will run in the unknown machines of the future.
You probably know C. It has be cloned a thousand times, in all tones, even in the C Sharp scale.
The whole download is 3.5 MB. And there is packed a system with all the headers and import libs to use the full Win32 API. The editor, including the debugger, the project generation facility, a versioning system, a software metrics module, an object code analyzer, etc, is 700K.
Yes. 700K.
Including a spell checker for C.
I noticed that the latest versions of Visual Studio show the current function at the top right corner of the window. Lcc-win32 has been offering this since 1999 but it shows it at the bottom right corner.
But this is publicity, and is therefore biased. Look for yourself, and tell me if you like it.
jacob
|
|
|
|
|
If you want to provide a tool, write an article and post it under the "Free Tools" section. This forum is for asking questions.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Yes. As the above poster suggested, please write an article and post it in the free tools section. That way your article will get seen by more users. A post in a forum will only be good for a few days because no one will scroll ahead more than a few pages of posts.
John
|
|
|
|
|
OK. Thanks for this tips. I will reword it and repost it in that forum.
jacob
|
|
|
|
|
I want to add the flexibility to my application to allow the user to write and use custom functions within the application. The functions would be added to a library. I don't want to write an interpreter. One thought I had was to let the user write C functions and write them to a dll source file, then my application could shellexecute a compiler and linker to generate the dll. The application could then turn around and call the dll function. All of this would be transparent to the user.
Now for the question. Can the VS C command line compiler and linker be shipped with my app?...I think I already know the answer, it would have to be licensed.
Is there a suitable free-ware compiler and linker that I could use?
Is there another way to skin this cat?...I don't want to try a VBA interface, but that might accomondate the largest audience.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|