|
I am face'g proble in the DLL. when I work in Debug mode the code work fine
/////--code is--//////
char* pCharPointer = new char[intLength];
//
//some code
//
pCharPointer = NULL;
delete [] pCharPointer;
///////////
But give error in release mode.....
//////////////////////////////////////////////////////////
If I change the code to
//////--code---/////
char* pCharPointer = new char[intLength];
//
//some code
//
//----pCharPointer = NULL;
delete [] pCharPointer;
///////////
it work's fine in release mode but give error in the debug mode...
It will be a big help if some body can clear WHY????
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
The first snippet is just wrong - you're overwriting the actual pointer to the memory block, which causes delete[] to simply do nothing in release mode. There's probably an assert in debug mode to tell you that you're trying to delete a null pointer.
If your debug mode is telling you about a problem, you should probably listen. Release mode doesn't do as much checking. Could you be corrupting this pointer somehow?
It would help if you posted the error message(s).
|
|
|
|
|
I wish to elaborate on what mike said.
char* pCharPointer = new char[intLength];
pCharPointer = NULL;
delete [] pCharPointer;
char* pCharPointer = new char[intLength];
delete [] pCharPointer;
delete [] pCharPointer;
pCharPointer = NULL;
delete [] pCharPointer;
INTP
|
|
|
|
|
pCharPointer = NULL;
delete [] pCharPointer;
Sir, are you blind? That if anything ought to raise suspicions.
--
If there was a problem, Yo, I'll solve it!
Check out the hook while my DJ revolves it.
|
|
|
|
|
Hi at all,
is there a way to send messages from an application A to an other
application B?
Application A is mine, application B is not mine. Application B has an icon
in the status bar.
With application A i would like to send messages, like WM_KEYDOWN or right
button click, to appliaction B via its icon on the status bar.
It is possible?
thanks a lot
roberto
|
|
|
|
|
hi there ..
there r ways to send info from one application to another Like memory mapped file, DLL hooking ...
for this in the above win95 u can work upon but u need control of both the application in this scenario.
you can refer any Advanced Windows book of Jeffry Richter of Microsoft Press
....
all the best..
....
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
roberto674 wrote:
With application A i would like to send messages, like WM_KEYDOWN or right
button click, to appliaction B via its icon on the status bar.
Get the HWND of Application B
and use ..
SendMessage(hWnd_B,WM_KEYDOWN,....);
To Get The HWND of B application USE
FindWindow
Hope it Helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Sure,
but the problem is the HWND from FindWindow is the handle of main application B. If application uses another window associates to at the icon on th status bar? the window that manages messages from mouse (right click and so on)...
the HWND of the main application B cannot be the same the window that do this.
can help me some shell functions for this?
roberto
|
|
|
|
|
Hi,
do you know about some libraries with which I could extract text from a pdf file?
Thanks
Pepe
|
|
|
|
|
|
i want general printer protocol wich one is used by each application in windows. in windows when we send print command then some data is sent to pronter driver for printing.that data format i want .
PLz if anybody knows this plz help me
|
|
|
|
|
Can I make sure that the height of the listbox of a CBS_DROPDOWNLIST combobox is not affected by the itemcount, if this count implies a smaller height as defined by creation?
|
|
|
|
|
Use CComboBox::SetDroppedWidth( UINT nWidth );
//sample
// The pointer to my combo box.
extern CComboBox* pmyComboBox;
// Find the longest string in the combo box.
CString str;
CSize sz;
int dx=0;
CDC* pDC = pmyComboBox->GetDC();
for (int i=0;i < pmyComboBox->GetCount();i++)
{
pmyComboBox->GetLBText( i, str );
sz = pDC->GetTextExtent(str);
if (sz.cx > dx)
dx = sz.cx;
}
pmyComboBox->ReleaseDC(pDC);
// Adjust the width for the vertical scroll bar and the left and right border.
dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);
// Set the width of the list box so that every item is completely visible.
pmyComboBox->SetDroppedWidth(dx);
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
How do I make sure that the height of the listbox of a CBS_DROPDOWNLIST combobox is not affected by the itemcount, if this count implies a smaller height as defined by creation?
|
|
|
|
|
Hi,
I've written a program in Visual C++ 6.0 that periodically outputs data to a text file. Now, however I need to output this data to a MS Access database. I've created a link to Access using the Class Wizard to autogenerate code from 'MSACC9.OLB'. I've then created an instance of _Application which then allows me to open/create a database.
The problems that I have are:
1) when Access starts up, as well as opening the specified database it also displays the 'Select Database' dialog. How do I get rid of this?
2) Now that I have my database open how do I go about opening a table and then inserting data into it?
I've created a DoCmd object which I attach to my _Application object, however when I call OpenTable I get 'member not found' error even though the table exists. This may be due to my lack of understanding of the VARIANT type, as I've only created it and then called SetString (passing in my table name) on it.
many thanks,
Andy
|
|
|
|
|
You are doing it the hard way, aren't you?
Why don't you use DAO or ADO? These will allow you to create your database, update it in the much more efficient way? And you do not need to have Access installed...
Good luck!
|
|
|
|
|
thanks for your suggestion however I forgot to mention that the people I'm doing want to have Access displayed so they can see graphs being updated during the simulation run of my software.
|
|
|
|
|
Hello,
If you develop application VC++ 6.0 you can use MS-Access 98 version. (or VB 6.0 Ad-Ins->Visual Data Manager) otherwise, displays the 'Select Database' dialog. I think you use in MS Access 2000.
With Regards,
R.Selvam
|
|
|
|
|
Dear All:
I now use CGridCtrl by Chris Maunder, and I add all the source files manually not by ClassWisard, that is to say I only use the command "Add Files to Folder..." to add all the files.
The question is I can't find all the classed by Chris Maunder listed in ClassWisard, also can't find all the message by Chris Maunder in the ClassWisard,what should I do?
BTW: I can't add the a grid like what Maunder said in the introduce?
Hoping...
|
|
|
|
|
You need to 'rebuild' your classwizzard file. To do this, rename (or delete but it's more dangerous) the .clw file from your project. Then open ClassWizzard and it will ask you if you want to rebuild it from your sources files. Say yes and select all the files (don't forget to select all the class from the control). That's it.
|
|
|
|
|
Sucessfully, what should I say... Thank you very much!
Another question: In Chris Maunder's introduce, he generate a dialog and insert a grid with a ID:IDC_GRID, but I inserted a grid manually without an ID, what should I do if I also want to have a grid's ID???
|
|
|
|
|
Hello,
I received some files (probably issued from a DBase 4 database and having a .dbf extension) and I would like to access it from a VC++ application to pick up some figures in it.
How can I do that and retrieve the right column/row ?
Any suggestion is welcome ...
Regards,
DD
|
|
|
|
|
You can use ODBC. Define a DSN onto your database with a dBase driver.
|
|
|
|
|
I don't know the structure of dBase, I juste have the copy of a .dbf file (containing the field that interressed me) taken in the middle of dozen others .dbf files.
With ODBC, is it possible to work on a single .dbf file, just to read some infos in it (no update to be done) without the whole dBase context or do I have to read the file in another way, like I would do it for a text file ? But, in this case, how to access the correct column/row, skip the kind of header at the beginning of the file, move from a record to another, etc ...
Regards,
DD
|
|
|
|
|
Qadddd wrote:
I don't know the structure of dBase
That's the beauty of ODBC... you have a common way of accessing all databases. Simply read (or write). You can select which field you want to appear, etc...
|
|
|
|