473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C++ Data Types from Templates

Dear All,


I am trying to write a wrapper DLL from the other SDK's template library to use applcaition in C++ and .NET.

For example

Class A;
typedef unsigned char c_UInt8;
A<c_UInt8> bufImage;

buf = bufImage; // here I am looking for the suitable and equivalnet data type of bufImage



Please advise me if you had any experiences on it and I am looking forward to hearing from you.


Thanks and best regards
Dec 16 '09 #1
3 1679
weaknessforcats
9,208 Expert Mod 8TB
The data type of bufInage is A<c_UInt8>. Whatever type buf is will require an operator= on class A.

Maybe you could explain further

BTW: a c_ does not make a variable a char or unsigned char. This sort of thing started back in the 1970's with assembly programming and has been dying a slow death. Mpst development tools today let you float the cursor over the variable and the type is displayed. Naming conventions are all failues since they rely on perfection by humans since the compiler cannot enforce the convention.
Dec 16 '09 #2
Dear All,



I tried to type cast the image memory of unsigned char * to unsigned long * as in here.

unsigned char *colorImage = new unsigned char[colorBmWidth * colorBmHeight * 3];
// Convert from unsigned char * to unsigned long *
unsigned long *lColorContent = (unsigned long*) colorImage;

My original data is 24 bits bitmap image and still couldn't managed to solve it even I searched the solutions in the internet.
Here is my debugging data
colorImage -> BM6̓
colorContent -> 3442888002

Actually, the colorContent must be colorContent -> BM6̓ but I don't know why there is errors there.

I am looking forward to hearing form you soon.


Thanks and best regards
Feb 10 '10 #3
weaknessforcats
9,208 Expert Mod 8TB
Probably there no errors. The default for disoplaying an int or long is to show the numbers. For a char*, it is assumed to be a string so it shows the characters until a \0.

BTW: This looks like C and not C++.
Feb 10 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: GrahamJWalsh | last post by:
I have a basic question regarding various data types (related to reinterpret_cast, static_cast). Lets say I have some declarations thus; int i = 444; unsigned int* uip; I then do...
3
by: lovecreatesbeauty | last post by:
Prof. Bjarne Stroustrup said "built-in data types have default constructor" at §10.4.2 in `TC++PL, special ed.'. He also said that "built-in data types are not classes" at §11.4 in `TC++PL,...
3
by: Pascal Brunot | last post by:
Hi, That's my first post here so I hope this is the right group to post to. I have to design a good strategy to manipulate XML data in VB.net language. Here's the business case: - I will...
4
by: No One | last post by:
Here is my problem: I have a certain set of well-defined manipulations that I have to apply to different types of data. In all cases the manipulations are exactly the same, and are to be...
6
by: LordHog | last post by:
Hello all, My lead wants to implement a data range monitor for a project that we are coding. Basically it performs a boundry checking that will take three parameters. I am/was trying to...
9
by: jc | last post by:
Hi all, I have a data type to use that I can't modify its codes. E.g. This template data type is data_type. When I declare a variable of this data_type, I write as following: data_type(8,...
5
by: lobequadrat | last post by:
Hello, I am trying to get the following code work (unfortunately not mine ... :( ) template <class Tclass Test { public: class ELEM;
7
by: Maximus Decimus | last post by:
HI all, I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced...
15
by: akomiakov | last post by:
Is there a technical reason why one can't initialize a cost static non- integral data member in a class?
3
by: Christopher | last post by:
Is it possible to dynamically create a data structure? Not that it matters, but just for understanding, I am working with video shaders, these shaders use thier own language (HLSL) which you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.