If this has been out of use for 2 years then I presume you only use it for personal projects. If that is the case then I would suggest you forget VC6 (unless you really need MFC) and go for the Visual Studio Express editions[^].
Good guess (MFC). I plan on the Resurrection of some old projects for the purpose of updating them. It helps to have the original development tools when working with old [GUI] code. Up until 2 years ago, all my cross-platform code included VC6 compatibility; I decided dropped that though.
Note: There are still commercial Apps the use MFC and posting for positions requiring it.
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
I am using VC++/Com application and working with database.
I am using '_RecordsetPtr' to fetch database tables.
Here 'RsITEM' Macro to get particular column data. Everything works fine unless you encounter with NULL value. If values comes to be NULL, it just throw exception, and application crashes. Not allowing null values in database is not solution in my case.
Without seeing more of your code i have 2 guesses: you are either writing into memory out of bounds (so e.g. you allocated space for 50 characters but are writing more than that into the buffer, 51 or 100 or... The other guess is, you are trying to free up memory you didn't allocate OR you are trying to free up the same block of memory twice.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
Judging by that function signature, GetResource will either allocate a string for you, or return a pointer to a string it stores internally (or statically). In either case, the pointer you pass will be overwritten, and any memory previously allocated that this pointer used to point to will be lost!
So, what you should do is:
1. do not allocate memory yourself!
2. initialize the pointer with NULL instead, before calling GetResource()
3. Check the documentation of GetResource() whether or not it allocates memory that needs to be freed or not. If your delete causes an error, then most likely it shouldn't be deleted, or it already gets deleted by whoever manages these resources.
i am using CreateFile to open the port,its working fine when i am handle this with only single port.
but now i want to open multiple port at the same time and perform read/write operation on these ports.
In The open port method, it opens the first available port and when it gets the second it closes the opened one and then opens the next port and so on.
//Close down the comms port
BOOL bSuccess = CloseHandle(m_hComm);
m_hComm = INVALID_HANDLE_VALUE;
TRACE(_T("Failed to close up the comms port, GetLastError:%d\n"), GetLastError());
//Free the event object we are usingif (m_hEvent)
m_hEvent = NULL;
//Call CreateFile to open up the comms port
m_hComm = CreateFile(sPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
//CPort_Class handels all port operation like open/Close and read and write//CAppClass its a main appclassvoid CAppClass::fun1()
for(int i=0; i<port_count;i++)
CPort_Class* p_c=new CPort_Class;