|
Thanks Suman, it works!
regards,
George
|
|
|
|
|
Hi,
I am glad to hear ur problem solved..
All the best!!
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Thanks Suman,
You are so knowledgable. I am new to ATL, and I may have some further stupid questions like this. Glad if you could continue to help.
regards,
George
|
|
|
|
|
George_George wrote: You are so knowledgable
Hi,
I am normal programmer only, I had overcome similar problems with MFC programs.
Sure, I will be there to help whenever I have time..
Best Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
No use of SetSDKPath in the entire solution. If you want to check source the reproduce the compile error, you can simply download the source from the link I posted in the original question.
regards,
George
|
|
|
|
|
Hi, I'm having a weird crash problem when running on debug mode. Any call to getFile() causes a runtime error.
Code:
inline std::string getSource( void ) const throw() { return source; }
inline std::string getDescription( void ) const throw() { return description; }
inline std::string getSourceLibrary( void ) const throw() { return sourceLibrary; }
inline unsigned short getSourceLibraryId( void ) const throw() { return sourceLibraryId; }
inline unsigned short getExtendedErrorCode( void ) const throw() { return extendedErrorCode; }
inline SdkStatusCodesE getStatusCode( void ) const throw() { return statusCode; }
inline SdkErrorCodesE getErrorCode( void ) const throw() { return errorCode; }
inline std::string getFile( void ) const throw() { return file; }
inline unsigned int getLine( void ) const throw() { return line; }
I'm using it on a boost test suite. the code is:
// Get some status
SdkStatus status = SdkStatusFactory::createStatus("TBaseTestSuite::test2", "TBase", 25, __FILE__, __LINE__, SDK_SUCCESS, SDK_NO_ERROR, 666, "Wazabi");
// Check the values
BOOST_CHECK_EQUAL(status.getDescription(), "Wazabi");
BOOST_CHECK_EQUAL(status.getErrorCode(), SDK_NO_ERROR);
BOOST_CHECK_EQUAL(status.getExtendedErrorCode(), 666);
BOOST_CHECK_EQUAL(status.getFile(), __FILE__);
BOOST_CHECK_EQUAL(status.getSource(), "TBaseTestSuite::test2");
BOOST_CHECK_EQUAL(status.getSourceLibrary(), "TBase");
BOOST_CHECK_EQUAL(status.getSourceLibraryId(), 25);
BOOST_CHECK_EQUAL(status.getStatusCode(), SDK_SUCCESS);
The runtime error is:
unknown location(0): fatal error in "sdk_status": dbgheap.c(1279) : Assertion failed: _CrtIsValidHeapPointer(pUserData)
I'd preciate the help.
Thanks
|
|
|
|
|
Hi,
As the problem related to Boost module, please try posting in boost forum also.
See the problem related to you in one of forum: boost::variant build crashes Visual C++ [^]
Check the compile options, loops etc..
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Is not boost related. It happens even if I don't use boost. It also happens with getSource() :S.
Any Ideas?
|
|
|
|
|
Hi,
Check if some buffer is overflow and causing stack corruption
If so, increase buffer size or whatever is right
Is ur application a DLL or something else?
--
"Programming is an art that fights back!"
|
|
|
|
|
There are no buffers in use :S. Yes, the program is the test suite for a dll. this is the complete source of the file where the crash happens:
#ifndef __THSDK_TBASE_SDKSTATUS_H__
#define __THSDK_TBASE_SDKSTATUS_H__
#include <string>
#include "Export.h"
namespace ThaoriusSDK
{
class SdkStatusFactory;
enum SdkStatusCodesE
{
SDK_SUCCESS = 1,
SDK_PARTIAL,
SDK_ERROR,
SDK_UNKNOWN
};
enum SdkErrorCodesE
{
SDK_NO_ERROR = 1,
SDK_NOTICE,
SDK_FATAL_ERROR,
SDK_CHAOS
};
class __TBaseExport SdkStatus
{
protected:
SdkStatus( void );
inline void setSource( const std::string& source ) throw() { this->source = std::string(source); }
inline void setDescription( const std::string& description ) throw() { this->description = std::string(description); }
inline void setSourceLibrary( const std::string& sourceLibrary ) throw() { this->sourceLibrary = std::string(sourceLibrary); }
inline void setSourceLibraryId( unsigned short sourceLibraryId ) throw() { this->sourceLibraryId = sourceLibraryId; }
inline void setExtendedErrorCode( unsigned short extendedErrorCode ) throw() { this->extendedErrorCode = extendedErrorCode; }
inline void setStatusCode( SdkStatusCodesE statusCode ) throw() { this->statusCode = statusCode; }
inline void setErrorCode( SdkErrorCodesE errorCode ) throw() { this->errorCode = errorCode; }
inline void setFile( const std::string& fileName ) throw() { this->file = std::string(fileName); }
inline void setLine( unsigned int lineNumber ) throw() { this->line = lineNumber; }
friend class SdkStatusFactory;
public:
~SdkStatus( void );
inline std::string getSource( void ) const throw() { return source; }
inline std::string getDescription( void ) const throw() { return description; }
inline std::string getSourceLibrary( void ) const throw() { return sourceLibrary; }
inline unsigned short getSourceLibraryId( void ) const throw() { return sourceLibraryId; }
inline unsigned short getExtendedErrorCode( void ) const throw() { return extendedErrorCode; }
inline SdkStatusCodesE getStatusCode( void ) const throw() { return statusCode; }
inline SdkErrorCodesE getErrorCode( void ) const throw() { return errorCode; }
inline std::string getFile( void ) const throw() { return file; }
inline unsigned int getLine( void ) const throw() { return line; }
private:
std::string source;
std::string description;
std::string sourceLibrary;
std::string file;
unsigned int line;
unsigned short sourceLibraryId;
unsigned short extendedErrorCode;
SdkStatusCodesE statusCode;
SdkErrorCodesE errorCode;
};
};
#endif
Personaly, I don't undertand why getDescription() works and getFile/getSource don't.
This is the function that is supposed to test the status
void sdk_status( void )
{
// Get some status
SdkStatus status = SdkStatusFactory::createStatus("TBaseTestSuite::test2", "TBase", 25, __FILE__, __LINE__, SDK_SUCCESS, SDK_NO_ERROR, 666, "Wazabi");
// Check the values
BOOST_CHECK_EQUAL(status.getDescription(), "Wazabi");
BOOST_CHECK_EQUAL(status.getErrorCode(), SDK_NO_ERROR);
BOOST_CHECK_EQUAL(status.getExtendedErrorCode(), 666);
BOOST_CHECK_EQUAL(status.getFile(), __FILE__);
BOOST_CHECK_EQUAL(status.getSource(), "TBaseTestSuite::test2");
BOOST_CHECK_EQUAL(status.getSourceLibrary(), "TBase");
BOOST_CHECK_EQUAL(status.getSourceLibraryId(), 25);
BOOST_CHECK_EQUAL(status.getStatusCode(), SDK_SUCCESS);
}
Any other idea?
Thanks
|
|
|
|
|
Hi,
Please try assigning "__FILE__" to some variable and use it while comparing.
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Did that, the crash happens anyway. Even if a comment out the getFile() line, it crashes on getSource(), but if a comment both lines out, it works smoothly.
I'm really screwed up here :S
|
|
|
|
|
Hi,
Most of the problems similar to your are related with strings.
Something like their scope in DLL.
You are setting and getting string values.
Try initializing them at first before set/get them.
There may be some initialization function for DLL, use if there is something.
If you have doubt in 3rd party functions you use, try posting the problem in their forum.
Best Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Hi,
I made a Stack implementation, and now I'm looking to make the implementation be more generic. I know that the way to do this is probably to use template. I have a cons list of items which is
template <class t=""><br />
class ConsList : public LList<t> {<br />
....<br />
ConsList(T first, LList<t>* rest);
}</t></t></class>
as of now. When I try to make an instance of the ConsList<int> with the new keyword, I get a lot of errors
g++ -o Main LList.o Stack.o Exception.o main.o<br />
Stack.o: In function `Stack::push(int)':<br />
Stack.cpp:(.text+0xaa): undefined reference to `ConsList<int>::ConsList(int, LList<int>*)'<br />
Stack.o: In function `Stack::Stack()':<br />
Stack.cpp:(.text+0xe5): undefined reference to `EmptyList<int>::EmptyList()'<br />
Stack.o: In function `Stack::Stack()':<br />
Stack.cpp:(.text+0x123): undefined reference to `EmptyList<int>::EmptyList()'<br />
collect2: ld returned 1 exit status<br />
</int></int></int></int>
I've googled templates, and it looks like nobody makes a new item that is a template. If there a reason why people don't use this, or how would I go about creating an instance of ConsList<int>(.., ..). Thanks,
-Ken
|
|
|
|
|
Maybe select the "Ignore HTML tags in this message" check box and re-post your code. There are a lot of sad faces in it.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Ken Mazaika wrote: Stack.cpp.text+0xaa): undefined reference to `ConsList::ConsList(int, LList*)'
It seems that you have n't defined the functions of the template classes. At the point of template instantiation the definition of the function should be visible where it is triggered by refering in the code (of stack). May be you declared the template class in a header file which doesnot have definitions (possibly you defined in LList.cpp) and included the header in stack.cpp. But template class requires the definitions also , so add the definitions in LList.cpp to the header itself.
|
|
|
|
|
Thanks for your response. That solved the problem completely. I created a LList.cpp file, which I didn't treat as a header, I added the template definitions to the header and it worked perfectly. Thanks again for your response!
-Ken
|
|
|
|
|
hhmm....how to find the center point of 2 lines using the visual c++. i need to find the center point of a track...actually,i'm using the video instead of static image. i have already got the binary image and stuck at this stage. please help me anyone?
|
|
|
|
|
umai wrote: please help me
Is it urgent?
led mike
|
|
|
|
|
|
umai wrote: how to find the center point of 2 lines
What two lines? What is the center point of two lines?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
let say, there is a track....my mobile robot need to move along the track...the track is about 3 cm width...the reference for the mobile robot is the center point of the track...how can i get the center point?
im using the edge detection method but still cannot find the center point
|
|
|
|
|
The midpoint between two points (x1,y1) and (x2,y2) could be found something like
(xMid, yMid) = ((x1 + x2) / 2, (y1 + y2) / 2)
I imagine for those two points, you'll need points on your detected lines that are perpendicular to the
robot...or something like that.
You'll need to do a little math
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Assuming the track delimiting lines parallel, at every point (of one of the two lines) you have to find the perpendicular line and choose on it the point that is halfway the two lines of the track.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Have you troubles with
(1) C++ language?
(2) Analytic geometry?
(3) Windows programming?
(4) Bitmaps
(5) All of the above stuff?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|