|
Assuming you are reading each byte one at a time, then the values are already integers. A byte containing the character 'A' is the same as the value 65 decimal. There is no conversion necessary, just accept the data as integer, not string.
The best things in life are not things.
|
|
|
|
|
okey. Thanks for your help.
|
|
|
|
|
The problem is that my hard drive crashed about 2 years ago and the original CD set is in storage in another state. Today I finally decided that I would like it installed on my XP machine. I have copied the recovered VC6 directory to my machined, but, of course, it needs to be fixed. Is there a list of directory paths and registry entries some where or some other fix.
Thanks,
INTP
"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
|
|
|
|
|
That would have to be a lot of work done manually and you might miss one or many things during the process. I would suggest a new installation for VC6.0 to be done on this machine.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
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[^].
The best things in life are not things.
|
|
|
|
|
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.
INTP
"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
|
|
|
|
|
John R. Shaw wrote: There are still commercial Apps the use MFC and posting for positions requiring it.
I didn't mean to imply that MFC is no longer current, it's just that it is not available with the (free) Express editions of Visual C++.
The best things in life are not things.
|
|
|
|
|
|
How can a program know if "Microsoft Visual C++ 2010 Redistributable Package (x86)" is installed. If possible, provide a sample code.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Thank you!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hello All,
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.
Any help in this regard is highly appreciated.
Happy Programming.
|
|
|
|
|
You need to check the Item for equality to VT_NULL before calling it's GetValue() method, like this[^].
|
|
|
|
|
Hi this is my code
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 15;
lf.lfWeight = FW_REGULAR;
m_fontRegular.CreateFontIndirect(&lf);//m_fontRegular is object of CFont
m_ctrlComboBrowsers->SetFont(&m_fontRegular);// m_ctrlComboBrowsers is object of CComboBox
i am adding some string to combobox, problem is in XP machine combobox's dropdown list is not showing....
please help me.
|
|
|
|
|
Have you done the layout of it in the dialog template properly?
In the dialog template, click on the drop down arrow of the combo box and resize the control by expanding it downwards.
|
|
|
|
|
its created dynamically... problem was same what u told, size of the combobox was not expanded size, that was the issue.but my doubt is why this problem is coming only in xp?....
thanks..
|
|
|
|
|
Hi,
Im declaring one char array in dialog Header File.
char *czTagGetVal;
And in one dialog class,im using that array as
void CGraphicsTagDlg:: GetTagLbl(int iLNo)
{
czTagGetVal = new char[50];
memset(czTagGetVal,0,50);
.
.
.
}
After debugging i get the solution without any error.But when i close the applcaition,in Output window i saw lot of Memory leak detection.
So while closing the application i delete this array as
if(czTagGetVal)
delete [] czTagGetVal;
But i get the error as
Windows has triggered a breakpoint in GraphicsTag.exe.
This may be due to a corruption of the heap, which indicates a bug in GraphicsTag.exe or any of the DLLs it has loaded.
How can i avoid this error.I used such kind of array in my applcation by using new operator.I want to delete all allocated memory.How can i do that.Pls help me.
Anu
|
|
|
|
|
You should change:
Anu_Bala wrote: char *czTagGetVal;
to
char *czTagGetVal = NULL;
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
[My articles]
|
|
|
|
|
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<
|
|
|
|
|
Im getting value by using this code
glg_animation[iPage].viewport.GetResource("\\Tag\\String",&czTagGetVal);
sTagName = (CString)czTagGetVal;
In OnClose(),when i debug this part of code
if(czTagGetVal)
delete [] czTagGetVal
czTagGetVal has value as "ALRMCAB ".So definitely it is less than 50 and also im allocating the memory using new and assign value also.But this error is coming.
I delete this char array at the end of the fucntion where it is actually using.But the same error is coming.
Anu
|
|
|
|
|
Shouldn't this:
Anu_Bala wrote: glg_animation[iPage].viewport.GetResource("\\Tag\\String",&czTagGetVal);
be this:
glg_animation[iPage].viewport.GetResource("\\Tag\\String",czTagGetVal); ?
But if you use this buffer in a function only, then why don't you simply declare it on the stack in the function?
void This_is_the_function()
{
char czTagGetVal[50];
...
}
> 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<
|
|
|
|
|
Actaully that GetResource() is third party fucntion(using DLL) and then GetResourceis decalred as
GetResource( char * res_name, char ** s_value );
So i have to use that.
Anu
|
|
|
|
|
That suggests that the function will allocate the string for you, so you don't need to do it, probably just free it (of course that depends on that 3rd party library). So like this:
void this_is_the_function(...)
{
char *czTagGetVal = NULL;
glg_animation[iPage].viewport.GetResource("\\Tag\\String",&czTagGetVal);
sTagName = (CString)czTagGetVal;
...
}
Be careful with freeing up memory allocated by 3rd party things because if you don't do the de-allocation that is in pair with the allocation you can get unpredictable results.
> 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.
|
|
|
|
|
Possibilities for Error:
- You've already deallocated this memory block.
- If you allocated within a DLL, you should deallocate within the same DLL. Don't do memory management across DLL boundaries.
Memory Leak:
- If the function GetTagLbl() gets called more than once, you'll have leaking memory by only deleting once when closing.
|
|
|
|