|
If you do your work in Large Font mode things will work out.
Todd Smith
|
|
|
|
|
i created new mfc application with multi doc/view. now, i would like to have also treeview in the main dialog. i would put it on the left of it. how to do that?
any ideas?
|
|
|
|
|
I dont have the exact idea... what all changes are to be made, but just for a help you can construct a new doc/view project with splitter window and checkout the OnCreate event of the frame thats where the splitters are created.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Option 1
Follow the excellent instructions from "Paul R Thompson"
Pauls Splitter Gear
Download and copy
MFC SplitterWnd Sample
Option 2
Copy this.
[1] Create new project (sdi)
Add this to MainFrm.h
CSplitterWnd split;
BOOL m_bInitSplit;
Initialise m_bInitSplit to FALSE in MainFrm.h constructor.
Override OnCreateClient in CMainFrame (alt+enter in VC 6.0 mode or ctrl-alt-x-click in BS .NET mode)
Add this
CRect cr;
GetClientRect( &cr);
if ( !split.CreateStatic( this,1,2) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
/* Note CTreeStuff is not defined yet. See later */
if ( !split.CreateView( 0, 0,
RUNTIME_CLASS(CTreeStuff),
CSize(200,50), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
/* you will have to change this to your RUNTIME_CLAS CView derived class */
if ( !split.CreateView( 0, 1,
RUNTIME_CLASS(CtmpView),
CSize(cr.Width(),cr.Height()), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
m_bInitSplit = TRUE;
ensure that you replace
return CFrameWnd::OnCreateClient(lpcs, pContext);
with this
return TRUE;
Add a MFC class CTreeStuff deriving from CFormView
Drag a CTreeCtrl and plonk it your form view.
Add stuff to your tree control.
Regards,
axe
|
|
|
|
|
Solution is good, but really this wont go to the inbox of the original poster.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
|
lordgreg is the person who needs the help... so when you reply to me he will not be notified about the solution that you have posted. Thats what i meant to say.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Check back on code project for answer to your question.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&df=100&app=50&fr=101
|
|
|
|
|
Hi Everyone,
I am looking for a SDK or a developer's tool that will allow me to write a program that will allow the user to visually edit an EMF file. In other words, I would like my program to let the user select different components of an EMF file and move or modify them.
Does anyone know of a SDK (C++ bases preferred) commercial or shareware, that could assist me in this project?
Any help is greatly appreciated.
Thanks,
A.
|
|
|
|
|
|
Thank you for the suggestion but this SDK looks to be a conversion tool rather than an editing/manipulation tool, which is what I really need. Once again thank you for the help and please keep me posted if you think of other sites.
A.
|
|
|
|
|
|
Thanks so much, you are great. I've been playing with their stuff all day and much to my chagrin it doesn't really do what I want. They are more about raster files and all that other stuff.
It's amazing to me that no one has come up with a SDK that allows you to edit an EMF file. I can't beleive I might have to develop this from scratch. I just hope I'm not missing something.
Anyhow, thanks again. I really appreciate it.
A.
|
|
|
|
|
I'm trying to use the SQLConnect function but I keep getting the odbc error 'Invalid string or buffer length'. In all the documentation it says to use SQL_NTS , but that doesn't work. It still doesn't work even if I put the actual string length in. Anybody know what's happening?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
How are you calling SQLConnect ?
dNimrod#X
________________________
|
|
|
|
|
forgive me for being slow, but I don't really understand your question. Here's a sample of the code I'm using, (the slen variables were just added for testing):
sr = SQLSetEnvAttr(hOdbcEnv, SQL_ATTR_ODBC_VERSION
,(SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER);
if(BadSqlReturn(sr))
MessageBox("Error In Setting ODBC Version.");
sr = SQLAllocHandle(SQL_HANDLE_DBC, hOdbcEnv, & hDbConn);
if(BadSqlReturn(sr))
MessageBox("Error In Allocating Connection.");
sr = SQLSetConnectAttr(hDbConn,SQL_ATTR_LOGIN_TIMEOUT,(void*)5,0);
if(BadSqlReturn(sr))
MessageBox("Error In Setting Login Timeout.");
char szConnectString[512];
sprintf(szConnectString,"%s",strConnect);
SQLSMALLINT slen = strlen(szConnectString);
SQLSMALLINT slen2 = strlen(szUID);
SQLSMALLINT slen3 = strlen(szAuthStr);
if(slen % 2) slen++;
if(slen2 % 2) slen2++;
if(slen3 % 2) slen3++;
sr = SQLConnect(hDbConn,(UCHAR*)szConnectString,SQL_NTS
,(UCHAR*)szUID,SQL_NTS
,(UCHAR*)szAuthStr,SQL_NTS);
if(BadSqlReturn(sr))
{
AfxMessageBox("connection error");
displayODBCError(sr,"");
return 0;
}
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Can you answer us two questions?
-- have you debugged strConnect ? I mean what is its value just before SQLConnect is called?
-- also, do you know what error occurs whilst connecting?
dNimrod#X
________________________
|
|
|
|
|
right before it's called the value of strConnect is:
"Driver={Microsoft dBase Driver (*.dbf)};DriverID=533;Dbq=c:\dbasetables\;"
the error I'm getting is the odbc error:
HY096 - 'Invalid string or buffer length'
If it's broken, I probably did it
bdiamond
|
|
|
|
|
The HY096 , according to the ODBC error list is regarding and Invalid information type and can be returned by SQLGetInfo .
Can you provide some more information?
dNimrod#X
________________________
|
|
|
|
|
I just changed my code to use SQLDriverConnect instead and now everything seems to work fine!! I'd really still like to know what was wrong with the other way, but if this seems to work, I don't see any reason to fix it. Thanks much for all your help!!
BTW: I'm using SQLGetDiagRec() to get the odbc errors back. In the documentation I have this error says that you either specified a length that was less than 0 but not SQL_NTS or that you specified a number too high for the maximum connection string length.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I'm facing a situation where it appears from tracing in my application that an attempt to allocate memory via C++ new is failing, natually only at the customer, and there only if the allocation is large. Every failure instance I've seen involves sizes just beyond 4K (say 4100 - 4400 bytes). Otherwise no problem.
Really scratching my head looking for a good next step in either diagnosis or adjustment / repair.
AJ
|
|
|
|
|
thats just over a page size isnt it?
anything wrong with the virtual memory settings?
"there is no spoon" biz stuff about me
|
|
|
|
|
Yes it is, but I'm drawing a blank on what virtual memory setting would function as an upper limit on a heap allocation request. (And also why the new would fail so catastrophically)
AJ
|
|
|
|
|
4K is not what I would call large by any means. Are you new'ing a large number of objects?
I can't recall ever seeing new fail. Maybe you've screwed the heap. A Debug Build with CRT Heap checking enabled may help.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
I wouldn't think 4K would be bad either. It is a single new, which allocates varying amount depending on amount of data attached to a print request. I can't say that I've got enough instances yet to prove 4K is a hard limit. And I've never seen a new fail this way either. Is the heap screwed? May very well be, but not on our systems running with the same program levels and even print data. Help in figuring out why it's screwed is part of why I turned here. I'll see what I can do with your suggestion. Thanks
AJ
|
|
|
|