|
If you're doing a course that has no course materials, I hope you didn't pay for it.
You need to buy a book, like 'teach yourself C++ in 24 hours' or something. Until you get to a point of basic understanding, you're going to have trouble finding help online. Stuff like how structs work, and iostreams, are widely documented on the web, if you're unable to use google to solve the question you asked, you're probably not at a level of being able to understand the sort of brief answers you will get on these forums.
Have you written any code at all ? What do you know how to write ? I'm trying to establish what I could tell you, and that you'd be able to follow.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello everybody,
I am a newbie to C++ programming and I need to do some hex addition with VC++ and then output the result as ASCII.
Here is my problem:
hex1(5A 30 35 30 30) which is equal to decimal(387355848752), I want to add hex(100) to hex1 which is hex2(5A 30 35 31 30) equal to decimal(387355849008). This is exactly equal to adding 256 to the first decimal.
I know unsigned int data type can only support 4294967295 which is still not enough for my case, and I would like to know how to convert these hex to ASCII with C++?
Your help is very much appreciated, thank you.
|
|
|
|
|
If this is a C++ question and not a C++/CLI question then you are in the wrong forum.
<br />
long long h1 = 0x5A30353030LL;<br />
long long h2 = 0x100LL;<br />
<br />
_tprintf_s(_T("%I64X\n"), h1 + h2);<br />
-- modified at 13:03 Saturday 2nd December, 2006
|
|
|
|
|
Thank you very much!
It works fine and I was in such hurry and I overlooked (Managed), and I should have posted on the VC++/MFC board? Sorry for my mistake.
Besides, how can I convert the resulting hex to ASCII string? Is there a function _tprintf_s(_T("%s\n"), h1+h2); ? I tried but it does not work.
-- modified at 13:35 Saturday 2nd December, 2006
|
|
|
|
|
what are the API's to detect the USB Device descriptor
Shiva....
|
|
|
|
|
|
I think the forum name must be changed. People see "C++/CLI" and think they can post questions on plain C++ or CLI, cause they are not aware of "C++/CLI". It's really confusing for beginners. I think the forum should be named "Managed C++", and Visual C++ forum should be named "C++ & Visual C++"
Although the discussion forum is (Managed) C++/CLI, from the drop down menu of "Message Boards" it is written "C++/CLI", and that's what is confusing people.
|
|
|
|
|
I absolutely agree with this idea! The name must clearly represent the topic, otherwise the "you're on a wrong forum" nightmare will continue. :->
|
|
|
|
|
It's funny, because you're posting in the wrong forum. There is a 'suggestions' forum.
I tend to agree in principle, but the fact is, I can't think of anything we can name this forum that will stop people from just seeing 'C++' and filtering out the bit they don't understand.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: It's funny, because you're posting in the wrong forum.
Great way to start my day! Thanks
led mike
|
|
|
|
|
Perhaps the only way it would work is Managed/CLI . Hard to swallow at first, but a good repellent to C++ newbies as well: two bits together that they don't understand.
|
|
|
|
|
I have noticed that even bookstores such as Borders inconsistantly shelve C++/CLI books with C/C++ or C# or VB or even by itself (all this in the same store at times). I guess C++/CLI is just a bad name since it is causing so much caos. Anyway, Microsoft is also responsible for OLE, COM, COM+, ActiveX, etc.
|
|
|
|
|
I think that the naming is one its greatest disasters. I am currently looking for a new job and would prefer if there was an element of C++/CLI, but it is virtually impossible to find a job spec that contains it. If you search for Managed you get back specs to do with being a manager and if you use the CLI keyword you often get Command Line Interface and other such acronyms.
There are vast Swathes of C Sharp jobs because C# is a really simple keyword to find that does not get confused for something else.
How is the use of C++/CLI meant to grow if programmers can't find jobs where it is being used!
|
|
|
|
|
There is a post at the top in red text explaining what this forum is for. But people don't manage to see (++) that.
|
|
|
|
|
Hi guys,
here is my problem I have defined a list of managed objects in MyClass.h:
<br />
class MyClass.h<br />
{<br />
public:<br />
MyClass();<br />
gcroot<List<MessageListener^>^> messageListeners;<br />
}<br />
and using the list in the .cpp file
<br />
MyClass::MyClass()<br />
{<br />
messageListeners = gcnew List<MessageListener^>();<br />
}<br />
void MyClass::addMessageListener(u_short id,u_short version)<br />
{<br />
MessageListener^ msgl = gcnew MessageListener(id,version);<br />
messageListeners->Add(msgl);<br />
}<br />
...as you can see I'm trying to use a list of managed objects in an unmanaged class.
My problem is than I can't access the objects in the list
<br />
void MyClass::findMessageListener(u_short id,u_short version)<br />
{<br />
<br />
for(int i = 0;i<messageListeners->Count;i++)<br />
{<br />
MessageListener^ msg = messageListeners[i];<br />
if(msg->id == id && msg->version == version)<br />
{<br />
return msg;<br />
}<br />
}<br />
return nullptr;<br />
}<br />
I would like to have some comments on how this can be done.
Thx
|
|
|
|
|
kristmun wrote: gcroot<List<MessageListener^>^> messageListeners;
kristmun wrote: MessageListener^ msg = messageListeners[i];
"messageListeners" is a gcroot template instance and does not have an operator []. You need to use the conversion operator ( operator T ) to get at the CLR List object before you can get to the indexer ([]).
MessageListener^ msg = ((List<MessageListener^>^)messageListeners)[i];
led mike
|
|
|
|
|
Works like a charm!
Thanks Mike
|
|
|
|
|
Hello,
In MFC's CRichEditCtrl , I could set paragraph spacing (before and after) by using PARAFORMAT2 . Is there a possibility of achieving the same functionality with .NET 2.0 RichTextBox in C++/CLI ?
I've seen several enormous hacks on using PARAFORMAT2 in C# , but I believe it could be done more elegant in C++/CLI (using raw /clr , without safe or pure enforcement).
Or perhaps is there a more convenient method to format paragraph spacing without using native calls?
|
|
|
|
|
Hello!
I'm trying to translate some codes from Verilog to C++ using Verilator.
As I could see, there are not many materials to search about it, and I'm getting a lot of errors during this process.
Anyone that works with or at least Verilog (VHDL) could help me?
Thanks a lot!
|
|
|
|
|
I think you're in the wrong forum, this is for C++/CLI, I think you want Visual c++.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian,
We need to change the name of this forum to "This Is not the Visual C++ Forum".
Hmm. Never mind! If we did that, we will get an increase of unrelated posts. 
|
|
|
|
|
I suspect a lot of people see 'visual c++' and assume MFC, and have no idea what 'managed' or 'CLI' means, so they just ignore it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Dear all
My company has a fax server pool that contains 16 faxes cards. We are using the HylaFax software http://www.hylafax.org/content/Main_Page[^] Which written in C language.
Now that software is good in that when a fax is coming, it transfer it to the correct card (tha card that is specified for the recipt)... But, when we send a fax, it handles tha job to the next available card in the Queu (not nesesarly to be the card that is specified for the sender).
If anybody knows how to enhance this software so it sends the fax correctly(using the sender card) I will appreciate his/her help.
Or if you have an alternative solution that not expensive to use. I will also appreciate that.
Best Regards
|
|
|
|
|
mhmo wrote: Which written in C language.
Then you can't possibly modify it using C++/CLI. If you want to know how to change this code, your best bet is the Visual C++ forum, although even that is a long shot. You probalby want forums dedicated to users of this particular software.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I am using visual c++ 6.0. I wish to use the COleVariant::GetByteArrayFromVariantArray member function
but the compiler generates error message : GetByteArrayFromVariantArray is not a member function of COleVariant. Why could this happen?? Is this function available only in VC++ 2005??
Is there any way to retrieve a byte array from variant array??
Thanks. I will appreciate any help from you.
|
|
|
|