|
I (and a couple of other people I have found out) have asked how to draw lines in RichEditView/RichEditCtrl. So far, no one has been able to answer the question. Anybody got an idea of how to do it?
|
|
|
|
|
Subclass the control using SubclassWindow, then handle the WM_PAINT message and draw your lines there.However you might need to handle some additional messages as well as scrolling, resizing, etc. could be involved.
Hope this helps.
|
|
|
|
|
I am using the RichEditView/Doc architure. I am using it so I can use formating as well as use the EN_LINK messaging. Will this interfer with the message handling in the RichEditCtrl?
|
|
|
|
|
Not if you are going to call DefWindowProc. Actually you will need to call this function because you will want first the RichEdit to display normally and after that make your changes.
|
|
|
|
|
I haven't work with subclasses in this way. Can you point me to info on how to use it? I tried help in Visual Studios but its as clear as mud. Thanks for the help.
|
|
|
|
|
plzz help.
how a can i write a program to copy function (as a whole) from one c++ file to another c++ file ,(appending to its end)
the inputs of the programe shoid be source file name,function name and destination file name.
|
|
|
|
|
iS CopyFile function of any use
|
|
|
|
|
It should not be. He wants to copy part of one file to a second file.
John
|
|
|
|
|
You will most likely need to write a simple parser that can identify the location of the function in the cpp file. You can use tools like yacc, bison. Or, if you know the signature of the function (return type, type and no. of params) just search for a regular expression that will match.
|
|
|
|
|
i did it in the following way and it worked.
but the problem is how to add the file header attached with the
function .this comes befeore the function
eg.
///////////////////////////////////////////////////////////////////////////////
//
// history=...........etc
///////////////////////////////////////////////////////////////////////////////
#include <afxwin.h>
#include<fstream>
#include<conio.h>
#include<stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
using namespace std;
void main()
{
CStdioFile csf("E:\\lastfunc\\ii.cpp",CFile::modeRead);
CStdioFile csg("e:\\cc.cpp",CFile::modeNoTruncate|CFile::modeCreate|CFile::modeWrite);
csg.SeekToEnd();
CString str;
while(csf.ReadString(str))
{
if (str.Find("SetupTls",0)>=0)
{
int i=0;
cout<<str.getbuffer(str.getlength());
csg.writestring(str+"\n");
="" do="" {
="" if(csf.readstring(str))
="" if(str.find("{")="">=0)
{
i++;
}
if(str.Find("}")>=0)
{
i--;
}
cout<<cout<<str.getbuffer(str.getlength())<<'\n';
csg.writestring(str+"\n");
="" }
=""
="" }="" while(i="">0);
}
}
csf.Close();
csg.Close();
}
|
|
|
|
|
i would like to know what is the difference between ftp and internet component download service.Difference
Be FaithFull To Your Work.
|
|
|
|
|
FTP = File Transfer Protocol (RFC959)
MSICD = Microsoft Internet Component Download = "system service for downloading and installing software from Web sites on the Internet and intranets" = SOFTWARE!!
Don't try it, just do it!
|
|
|
|
|
i've hav the code to record voice using vc++ code.i dont knw how to go abt saving the file automatically as a part of the same project.can somone help me out?
Nilegna
|
|
|
|
|
Create a wave header, save it to a .wav file, write the audio data captured from the record device, and when recording is finished you only have to write a new file size to the wave header.
I thing there are some articles about creating .wav file on CodeProject. Have a look at them.
Don't try it, just do it!
|
|
|
|
|
I created a Setup-Project for my c++/MFC-proramm. It works fine an I can write "static" data to the registry which I defined in the project.
But I want write some more information in the registry which I want to define during the installation-process. I don't know, how to write for example the installation path in the registry, because I only can define fix data in the setup-project.
thanks for help
Gabriel
|
|
|
|
|
hello,
I have a combo box with edit list of numbers 3,4,5.I then have 5 edit boxes.Depending on number chosen in combobox i immediately want the same number of edit boxes to be enabled(I have made them disabled while creating).
This functionality should be made available immediately before OK button on dialog is clicked.I tried using ON_CBN_EDITCHANGE,ON_CBN_SELENDOK message handler but it doesnt work...
help urgently
thanks
|
|
|
|
|
The event for selection changed is the one you want, surely ? CBN_SELCHANGED
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys,
I have a strange problem , i have the next code :
i have a global variable CWnd* pWnd;
CMyClass::OnBnClickedBtn1()
{
pWnd = FindWindow("Shell_TrayWnd",NULL);
pWnd = ShowWindow(SW_HIDE);
}
and
CMyClass::OnBnClickedBtn2()
{
pWnd->ShowWindow(SW_SHOW);
}
I manage to hide and show the taskbar without problems,
but after that such problem appears : For example i have several windows open and their buttons appear on the Taskbar and when i click on any of the buttons on the Taskbar it's window does not get the focus(does not show up)??
The problem is in ShowWindow(SW_HIDE) , if i remove it then everything works fine ,but i need to hide the taskbar.
Can anyone help??
Regards,
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
I think, pWnd is pointing to Taskbar only if OnBnClickedBtn1() message is invoked. Try pWnd pointing to taskbar in OnBnClickedBtn2() message also.
Work had and a bit of luck is KEY to SUCCESS.
|
|
|
|
|
hello
can any body help me!actually i have to read the header of .dbf file.but it is not possible to make structure and get all header information at same time.then how could i get header information of Dbase4 file byte by byte?
actually i am newer to VC environment
|
|
|
|
|
Hi, I 'm experiencing the following problem with global objects. In a program with global objects at the beginning the constructors of these objects are executed and then the program enters in the main function. Everything its ok. Now I doing the following:
<br />
#include "foo.h" <br />
MyClass obj; <br />
MyClass::MyClass(void)<br />
{<br />
...<br />
}<br />
...<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
...<br />
}<br />
If the following code is compiled as one project everything is fine. Now the trick is that I compile foo.cpp as a static library (foo.lib) to which my main program links. Running step by step with the debugger (VS .NET 7.1) I found out that main is called first. Actually placing a breakpoint in my object's constructor I noticed that the constructor is never executed. Why does that happens? If I compile foo.cpp as a dynamic library (dll) will I have the same problem?
Thank you,
Themis
|
|
|
|
|
if you examine 'obj' once the program gets into main, can you tell if the ctor has been called ? i'm wondering if the ctor happens before the debugger can see...
i do global vars in static libs all the time, and don't have any problems.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
If you set a breakpoint at the constructor the debugger will see it.
If I use the global var in my main program then the constructor is called. However what I want is not to use this object. I dont even want to know its existance out of my .lib, I just want to execute sth just before main begins.
Themis
|
|
|
|
|
if u really want to know that global object ctor is call (which will definate be called when the object is instantiated).put this in the ctors cout<
|
|
|
|
|