473,473 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem wyth colors (uint, hexa)

This is the problem, i have a ocx, that have one control and one uint
Property, like this
Property color, acept values uint, Manually i set the value as this:

object.color = 0xFFFFFF;

for wythe color, i want to set the color using:

ocxObject.color = colorDialog1.Color; /// this is the error

and i get the error, because the ocxObject.color only acept uint

i make the convertion:

ocxObject.color = (uint)(colorDialog1.Color);

and not have error in code but, the colors not Match.

any solutions thanks
Jan 18 '08 #1
1 2258
<al****@gmail.comwrote in message
news:52**********************************@c23g2000 hsa.googlegroups.com...
This is the problem, i have a ocx, that have one control and one uint
Property, like this
Property color, acept values uint, Manually i set the value as this:

object.color = 0xFFFFFF;

for wythe color, i want to set the color using:

ocxObject.color = colorDialog1.Color; /// this is the error

and i get the error, because the ocxObject.color only acept uint

i make the convertion:

ocxObject.color = (uint)(colorDialog1.Color);

and not have error in code but, the colors not Match.
Try applying the method ToOle in the class
System.Drawing.ColorTranslator. This converts a System.Drawing.Color to an
OLE Color, which might be what your OCX is expecting.

Jan 19 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dany | last post by:
Hi When I open an Hexa file I have some weird char like when I open it with Notepad. I want to open it in a readeable form (ex: "FF25AB") like with Ultra edit. Thanks regards, Dany
1
by: Bren | last post by:
I'm hoping somebody can help me with the following problem. I'm hoping it's not insurmountable. Here's a basic structure: class EventTarget { public: EventTarget(); virtual ~EventTarget();
4
by: Jon Pope | last post by:
Many of my users have their sound cards muted, so I need some way of alerting them visually that a message box has appeared on a form that could be hidden beneath other open applications. I've...
0
by: Greg | last post by:
Not sure if this is best place for this problem, but here it is. I have a project that is simply a C# class that interfaces with an IFilter. This is so I can retreive the text from Word docs. ...
2
by: gilad | last post by:
Hi, I seem to be having a problem getting a context menu to work in Explorer. The menu item installs fine, but when I click it a message box should pop up indicating the command was received and...
14
by: Murkland | last post by:
Hi. I have a problem with a template class that I'm trying to inherit from. The code for the base class is: template <class T> class BaseClass { public: BaseClass(); ~BaseClass();
7
by: petedawn | last post by:
hi guys, based on users button press i am passing the following to my javascript function, test('&eacute;'). and within my javascript i have this function test(x) which processes this input. ...
2
by: sarchanakumar | last post by:
Hi friends, I want to write a program to add two hexa-decimal numbers. I know there is no way of direction addtion. My logic is, first convert two hexa-numbers into decimal after that we add and...
5
by: Vibhesh | last post by:
I am facing problem with TimeSpan structure when DirectX is used. Following is the sample code that causes the problem: ...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.