|
It seems like you need better (ideally complete) separation of your GUI and data. CLoading shouldn't know anything about the parent view's tree controls or other GUI elements. All you should pass back and forth is a pointer to a data structure.
I'll send you a sample FormView app with a progress dialog this weekend. It's probably easier to look at the code and compare it with your app than discuss it here!
It really is very simple. I promise!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have a VC++ Dialog Application and want to add a Excel component like the way one does it in MS word . I want to view the Excel chart as a component on my dialog . Can this be done ? If yes where should i get resources ? Thanks
|
|
|
|
|
You can use the MS-Chart ActiveX which is shipped with Visual C++.
François
|
|
|
|
|
As far as my preliminary search I can just plot a graph . I need the same functionality of a excel workbook where I can write data to a cell .My consideration is that I can use 3rd party grid's but I need to add a lot of data to one column . Is there any control that u might know that can take a lot of text(somehting like a log file in a cell !).
|
|
|
|
|
Here is my code
CStdioFile myfile,newFile;
CString inString = "";
char* fString="";
//char *pattern="((\\s*lmp\\s*))";
char *pattern="\\s*(LMP\\([0-9]+\\)).*)\\n";
//***********The line below when reached //causes abnormal termination,dont know /whats the problem Please help
RegEx exp(pattern,TRUE);
std::string wholeFileStr="";
CString wholeFileString = "",filname="c:\\test23.txt",nName="c:\\MunnaMunna.txt";
// Read entire file into a string.
try{
myfile.Open(filname,CFile::modeRead | CFile::typeText, NULL);
newFile.Open(nName,CFile::modeWrite , NULL);
}
catch (CFileException e)
{
MessageBox("The file " + filname + " could not be opened for reading", "File Open Failed", MB_ICONHAND|MB_ICONSTOP|MB_ICONERROR );
//return FALSE;
//myfile.Close();
//newFile.Close();
}
try{
while (myfile.ReadString(inString))
{//newFile.WriteString(inString);
//wholeFileString += inString;
wholeFileStr = inString.GetBuffer(2);
//
//const char *wholeFileStr=(LPCTSTR)inString;//.GetBuffer(10);
// RegEx exp("(\\*sLMP((0-9)+\)).*)\n$",TRUE);
// RegEx exp("(\s*LMP\([0-9]+\))",TRUE);
// RegEx exp("\s*LMP",TRUE);
if(exp.Search(wholeFileStr))
{
//strcpy(fString,exp[1].c_str());
CString sd(exp[1].c_str());
AfxMessageBox(sd);
}
else if(fString!="")
{ CString temp(fString);
//CString temp2(wholeFileStr);
temp+=inString;
temp+="\n";
//strcat(fString,wholeFileStr);
//strcat(fString,"\n");
newFile.WriteString(temp);
}
}
//***************************************************************
}
catch (CFileException e)
{
MessageBox("The file " + filname + " could not be opened for reading", "File Open Failed", MB_ICONHAND|MB_ICONSTOP|MB_ICONERROR );
//return FALSE;
//myfile.Close();
//newFile.Close();
}
newFile.Close();
myfile.Close();
|
|
|
|
|
My guess would be that RegExp is throwing an exception because the regular expression passed to it in the constructor is invalid (i'm not a regexp guru though, so am not able to verify that your regexp is correct). I suggest you check your expression, and also check the docs for RegExp - it may throw an exception that tells you exactly what is wrong. At the moment you are ignoring any such exceptions, and hence the program terminates.
Dave
|
|
|
|
|
DOCs say the 2nd parameter of the constructor of RegEx is a RegexOptions (A bitwise OR combination of RegexOption enumeration values) and not a BOOL.
|
|
|
|
|
I am using the CRegex class as am not good in using stl,i know now the pattern to be used for searching is not correct but dont know what the problem is ,basically what i am trying to do is look for lmp() in each line and remove new lines after all the lines that dont have a line wih lmp() beofre them,that way all the lines will start with lmp()
|
|
|
|
|
I am looking in the dev environment and cant find (vc6) the setting which lets it get past handled exceptions....
Appreciate your help,
ns
|
|
|
|
|
|
Ah! Thanks!
Appreciate your help,
ns
|
|
|
|
|
I've been doing COM/DCOM for several years now but not a lot with windowing
or controls. I want to create an executable that behaves as follows:
1. Singleton process that is a window (dialog would be fine) that can be
launched from another app (toolbar). Currently we use this paradigm with
VB components but want to do this one in C++.
2. This main window will contain a dynamic number of buttons that when
pressed will display a modeless dialog that contains some static data (i.e.
no user interaction other than close).
3. The buttons in the main window contain both text and a bitmap. These
buttons are updateable (i.e the text and bitmaps change) when certain
underlying statuses change.
Right now I have this prototyped in MFC with a main app window. The
buttons are subclassed CButtons and I create as many as I need when the app
starts. The buttons are ID'd so when the user presses it I know which type
of dialog to open. The real problem is how to wrapper all this in COM so
that this app can be created/started once via COM and then handle the
windowing/controls. I guess I'm more comfortable with MFC and not used to
CDialogImpl and the like. Anyone got any pointers or examples to start
from? Thanks!
|
|
|
|
|
(1)How can i use a dll in VC++ which is designed or written in VB ??
please help me as soon as possible.
it is very urgent for my project.
Thank- You
sukhdeep
|
|
|
|
|
kulsukh wrote:
(1)How can i use a dll in VC++ which is designed or written in VB ??
Search the documentation for IDispatch.
|
|
|
|
|
you might be able to import the DLLs typelib. this will create a C++ wrapper class for any objects exported by the VB DLL, using _com_ptr .
look into the "#import" directive.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Does anyone know of a tutorial that will step me through how to use this class. I've found several that show how to use a class they created. I want to know how to use this class.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
www.codeguru.com has a lot of mini-articles that show you how to do specific things with a CTreeCtrl. very handy for beginners (or old-timers who just forgot how to use that beast).
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
is it possible to read a hidden or minimized window into a bitmap?
Thanks to you all;)
|
|
|
|
|
|
Hello,
can anybody help me please?
Unfortunately I do have a problem with my FormView Frame Window. The Frame window shows always "unknown" as title name and I want to change it to a specific name, but without opening any document or creating any document.
Many Thanks
|
|
|
|
|
Look at overiding: CChildFrame::OnUpdateFrameTitle() and CMainFrame::OnUpdateFrameTitle()
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Another solution is UpdateFrameTitleForDocument().
Kuphryn
|
|
|
|
|
hy, i would like to make a toolbar in my mfc-app, that looks like the one from office 2003!
(pix: http://www.zdnet.com/supercenter/stories/review/0,12070,561909,00.html)
any idea how to do that??
thanx,cheers
|
|
|
|
|
Can someone explain to me exactly what an owner drawn listbox is? Is it like a button where you have full control of what it looks like and you use a bitmap, or is it just a box like the regular listbox where the contents are drawn by you? I am looking to create something where the "listbox" can have any shape and same goes for the scroll bar (Win32) because I am skinning my app. Can someone point me in the right direction concerning this issue?
|
|
|
|
|
An owner drawn list box allows you to customize the drawing of each entry. If you want to radically change the shape and appearance, you might want to derive from CWnd instead.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|