|
|
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
|
|
|
|
|
The problem probably isn't where you think it is. Normaly when this type of error occurs it is because of a miscalulation which eventualy caused a memory overwrite that occured some time earlier in the program. Therefore, you need to look backwards at what happen before you made the allocation, it most likely occured in some other function usualy one that was called from the current function or one of the functions up the line that eventualy called the function where the failure. One way that might help track down the problem (that I have used) is to use TRACE, in all realated function (nomaly same class) to show every allocation/deletion and read/write invold. For an example of what I am talking about download a CDibData (@codeproject), it contains code for doing this type of tracking. I had the same problem when I wrote that code (and others) and did not bother to remove the tracing (yet!).
Well, I hope this helps!
Good luck!
INTP
|
|
|
|
|
Thats right that the problem is almost definately not where you think it is.
I mean look at the definiton of new.
void* __cdecl operator new(size_t nSize)
{
void* pResult;
#ifdef _AFXDLL
_PNH pfnNewHandler = _pfnUninitialized;
#endif
for (;;)
{
#if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
pResult = _malloc_dbg(nSize, _NORMAL_BLOCK, NULL, 0);
#else
pResult = malloc(nSize);
#endif
if (pResult != NULL)
return pResult;
#ifdef _AFXDLL
if (pfnNewHandler == _pfnUninitialized)
{
AFX_MODULE_THREAD_STATE* pState = AfxGetModuleThreadState();
pfnNewHandler = pState->m_pfnNewHandler;
}
if (pfnNewHandler == NULL || (*pfnNewHandler)(nSize) == 0)
break;
#else
if (_afxNewHandler == NULL || (*_afxNewHandler)(nSize) == 0)
break;
#endif
}
return pResult;
}
Look at the for(;;)
It should not fail.
You have corrupted the heap.
Get MMGR from http://www.fluidstudios.com/publications.html .
It is an excellent class.
Ensure that you carefully read the instructions [ especially the order of includes].
Use it on Debug and Release builds.
Check that you have not used new and free or similar.
Check for resource leaks.
Regards,
axe
|
|
|
|
|
You will have to forgive me for getting some of the terminolgy wrong or asking what may seem like a newbie question.
I've got years and years of programming experience, mostly C and mostly embedded, so I don't write a lot from scratch for the PC environment. But give me any existing code in almost any language, and I fix items or add new features.
So, I just got into the Home Theater PC scene, bought an LCD display for the case, and now am a beta tester for the control software that drives the LCD. The company just recenly released to the beta testers C++ code that implements a plug in via a DLL to their software. Fine, no problem.
Using Visual Studio .Net 2003 I have successfully made three additional plug is to "expose" different information to the LCD control software, i.e. an example would be going to a Web Server and getting weather information to display.
Well, now I want to display information from S.M.A.R.T. hard drives. I found a publicly available .DLL that uses the COM architecture. Took a little bit of time figuring out how to invoke this in .Net, but I got it working. In fact, it's very cool how you just add a reference and it builds an "Interop::xxx" wrapper for you. Then you can just create an instance of the class, and off you go.
So having implemented and tested my logic for getting the data I wanted from the COM DLL, I then went about and created a new project for the DLL planning to cut and paste my logic with appropriate adjustments into my MFC DLL. Wrong!
I've done tons of searches and tried all different ways, but I'm not even close to getting this working. So my question is can someone point me in the right direction or post some sample code? It seems to me that I need a .h file or something that describes the interfaces. And even if I get a pointer to the interface, how do I get the structures that the interfaces are passing back? It seemed like it was going to be such a piece of cake the way the .Net worked.
Any and all help would be appreciated. I can also post or email the zipped project and DLL if it would be helpful.
Charlie
|
|
|
|
|
Found solution, and have working. Needed #import directive, gave me access to interface and methods.
Charlie
|
|
|
|
|
Hello,
I have noticed that whenever I exit my VC++ MFC app a msg appears in the Debug tab. The message is (in bold):
.
:
.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mslbui.dll', no matching symbolic information found.
The thread 0xB8 has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
strcore.cpp(118) : {52842} normal block at 0x00C49118, 14 bytes long.
Data: < . > 01 00 00 00 01 00 00 00 01 00 00 00 2E 00
.
:
.
Can someone tell me if it is normal for this to happen in Debug mode?
dNimrod#X
________________________
|
|
|
|