|
I believe I asked how to convert a number from normal base 10 to hexadecimal, base 16. Now I need to go the reverse, I need to convert a hexadecimal string to a base 10 number...ie: 14 in hex is 20 in decimal, 3C in hex is 60 in decimal.
|
|
|
|
|
|
That looks like the function I need. However the following should work (I think) and doesn't.
long temp = strtoul("0x14", NULL, 10);
I thought this should return 20 (the decimal value of the hex-string 14), however it returns 0, which means that it couldn't convert the string....what am I missin?
|
|
|
|
|
0x14 will not convert when base is 10. Use one of these:
temp = strtoul("0x14", NULL, 16);
temp = strtoul("14", NULL, 16);
Note that '0x' prefix is optional.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
The code I'm using to set the image list and load the bitmap resource is as follows:
m_CImageList.Create(20,20,ILC_COLOR,2,10);
HBITMAP hBitmap = LoadBitmap(_Module.GetResourceInstance(),MAKEINTRESOURCE(IDB_CLOSEDFOLDER));
m_icons[0] = m_CImageList.Add(hBitmap,(HBITMAP)0);
I've tried ILC_COLOR32, and all the other ILC_ variations, and the icon comes out grey instead of color as it should.
-Jack Mott
jackm@scalablesoftware.com
|
|
|
|
|
How to insert data in CHtmlView from a string table without using the Navigate/Navigate2.
|
|
|
|
|
How can I create an Add-in for Outlook 2000 using Developer Studio ?
Thanks for your answer...
Georgina
|
|
|
|
|
Go to msdn.microsoft.com and do a searh for ComAddin.exe or ComAddin. Its a sample add-in for the Office programs. It takes a little modification to get it to work with Outlook, but it's not that hard.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hi,
I'm having problems using EnumEnhMetaFile. The problem is that on
some systems it does not call the callback function. The return value is
success. Everything is done according to MSDN samples.
I've made some logging version of the program, using same wmf file to
enumerate. On both systems (the one where it works and the one where it
does not work) there are same parameters for EnumEnhMetaFile.
It works on most of the machines but on some systems it does nothing.
It does not depend on opererating system. We have users with two
computers with same version of windows. On one it calls the callback
on another it does not.
The big problem is I am unable to reproduce the problem here to be
able to debug it. We have no reports of this problem on WinNT/2000.
I belive it can be some conflict with installed software, but who knows?
Thank you for any idea what is wrong.
Pavel
pavel@minar.cz
|
|
|
|
|
Hi there,
Supposing I have two header files called header1.h and header2.h - and I have two sourcefiles called source1.cpp and source2.cpp, which contain the constructors etc for classes declared in the respective header files.
Now, I want to call a public member function from source2.cpp that was declared in header1.h. Obviously I can do this OK from source1.cpp but I can't do the same from source2.cpp.
I realise this is a basic question but I'm a newbie. Any help (and examples) would be greatly appreciated. I've had a good old hunt around my books and MSDN but can't find a solution.
E.g.
Header1.h
---------
class A
{
public:
void member_function();
}
source2.cpp
-----------
#include "Header1.h"
...
...
void calling_function(void)
{
// this won't work
member_function();
}
Thanks in advance!
|
|
|
|
|
Stephen,
you're thinking too plain C...
You define a class A having a member function (also called method) member_function. Your calling_function will call a function member_function having on the global namespace, which doesn't exist.
This will work:
....
A myInstanceOfA;
myInstanceOfA.member_function();
....
Or, if you have *very good* reasons to have static functions in your class:
class AA
{
public:
static void static_member_function();
};
then this will work also:
....
AA::static_member_function();
....
Thomas
|
|
|
|
|
Thanks for the help guys, but still no luck.
On declaring an instance of the class (in a different sourcefile than the one containing the constructor) as advised, I receive the 'Classname' : undeclared identifier error. I have included the header file containing the class's definition at the top of the sourcefile.
Is there something obvious I'm missing? (apart from a brain).
In case it helps, I'm using VC++6 and it's an App Wizard generated SDI project.
Cheers, Stephen.
|
|
|
|
|
What is looks like your missing is context.
To call a member function(method) it must be called in association with an object of the class it belongs to.
You declare, say
class A {
..
public:
void member_function(void);
...
};
you have to call it like this:
{
A anInstanceOfa( ... ); // create an instance of A
...
anInstanceOfa.member_function();
...
}
or maybe: A *ptrA = new A(.. )
ptrA->member_function();
the member_function is only meaningfull in the context of a specific object of
type A.
|
|
|
|
|
hia,
how do we reset a file pointer to the beginning of the stream?
if we have an input file stream fin, then the following code complains about ios_base. what do i do???
fin.seekg(0, ios_base::beq);
please help. thanx.
|
|
|
|
|
Hi !
Try ios_base::beg instead of ios_base::beq ... or it just was a misprint ?
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
hi,
you're right, i was misreading - and hence, mistyping - the beg thing. but it doesn't work that way either... the error message is
error C2653: 'ios_base' : is not a class or namespace name
i'm sure you know what it means. i guess i have to include something or the other but am not sure what. please oblige.
imran.
|
|
|
|
|
Hi again !
What headers files you've included into you source code where you're using ? (e.g. #include <fstream>).
Take at this - it was compiled OK by VC++6
#include <fstream>
using namespace std;
fstream file;
file.seekg(0, ios_base::beg);
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Check "Differences in iostream Implementation" in the Visual C++ Programmer's Guide
If you are using the old iostream library ( <fstream.h> ) you have to use ios::beg instead.
If you are using the standard library ( <fstream> ) you can use either.
|
|
|
|
|
i have a problem maybe you will be able to solve it, i have a pointer to the internet explorer i want to copycat the ctrl+n key and make another window, but hidden ..
that's means to take the first document(+cookie and other things) and pass it to a hidden internet explorer that still i will have a pointer to him.
do you have any idea?
thanks,
|
|
|
|
|
Hi All,
Again problem with Threads.In an application I am creating three threads each thread trying to call a interface function(This function tries to add records to a Database) of a Component.CCI is succeeding ,I am getting Interface pointer.Since each Thread tries to add the Record there should be 3 Records in Database.But, there are only 2 records.I am using CreateThread(...) for creating the Threads.In the Debug mode there is no such problem.There are 3 Records added to the Database.Also, if in this scenario I give Sleep(0) then no problem .
Where am I going wrong ?
Thanx in advance for the help.
Regards,
yamini
|
|
|
|
|
What kind of database is it, if it's sql server, maybe try to put a store procedure and then the interface should call it.
|
|
|
|
|
Hi,
I am using MS Access Database(no stored queries).I am sure the problem is not with Interface pointer as while Debugging the program works perfectly.So,pls tell me if there is problem with some other part
if the application I have mentioned .
|
|
|
|
|
Need to know a bit more. Is the component shared among threads? What threading model is being
used? Is a shared DB connection being used? One thing that springs to mind about debug ~vs~ release is the speed. As release is faster, it may be causing a problem. How does Access do
its locking, is it per row, table or block? if per table or block you may need
to synchronise access to the DB to prevent collisions.
HTH.
|
|
|
|
|
Without knowing all of the facts here is my guess:
This sounds like a classic "race" condition. The database record lock and your writes in the threads collide with each other. To prove if this is the case try adding three different, long delays to the threads (e.g. Sleep( 100 ), Sleep( 200 ), Sleep( 300 ). If this works, your database and interface is OK and you have a timing problem. You must synchronise the writes or retry on error.
Have Fun!!!
|
|
|
|
|
Hello every body,
My questio is: how can I insert in a View in a Dialog Window?
Thank you for your help
Giancarlo
Giancarlo Amati --> amati@iei.pi.cnr.it
|
|
|
|