|
Did not think this post would generate so many replies!
Many thanks everyone.
Cheers,
Keith
|
|
|
|
|
I've just had a thought about my previous response, for 64bit applications any pointer arithmetic will need to be done on a long rather than an int !
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I was going to reply that to your first post, but then I though "it has a native part, so it will probably be 32bit only anyway" and decided not to post.
|
|
|
|
|
That's a dangerous assumption that's bitten us on the ass in the past, unless you like thunking the app down to 32 bit later on.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Just because that happened, doesn't mean it's likely
Besides, OP knows how many bits he's using
|
|
|
|
|
harold aptroot wrote: Just because that happened, doesn't mean it's likely
Funnily enough, those are almost exactly the words that the client architect used when he landed us with the POS that we ended up having to fix.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That's a nice coincidence, but it means nothing
Plus, OP knows how many bits he's using - if that was 64 and he uses int anyway it's entirely his own fault
|
|
|
|
|
Sorry harold, but on this one I have to disagree.
harold aptroot wrote: if that was 64 and he uses int anyway it's entirely his own fault
If he inherits other peoples code that does this, then it's not his fault.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
He'd be asking a different kind of question if he were
|
|
|
|
|
I was sitting watching a film with the family and it suddenly popped into my head! It's better dealt with now rather than later when his pointers turn out to be invalid and he has no clue why.
I've just knocked up a utility struct wrapping IntPtr with arithmetic/conversion operators built in for future use prompted by this to solve this problem the next time I need it. Not sure whether to post as a Tip or just as an answer to the OP...
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Why not do both? As tip + a link here?
If you'd just post it here, it would get buried in the avalanche of posts..
|
|
|
|
|
Done[^]
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Looks good, this will come in handy
|
|
|
|
|
I've just posted a small wrapper struct around IntPtr that might help!
Here it is[^].
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hi Sir,
I am a reading a character typed from combobox.
But for the first time,the value is getting empty
I am trying with this code :
void comboBox1_KeyPress(object sender, KeyPressEventArgs e)
{
string str;
str = comboBox1.Text;
MessageBox.Show(str);
}
In VC++ i used this and got the text,
void CTest1View::OnEditchangeCombo1()
{
CString strTemp;
m_ctrlCombo.GetWindowText(strTemp;);
}
Am i in the right function??
Thanks
Raj
|
|
|
|
|
You need to set the index, by default the cbo value is set to -1 that's why you getting empty string.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hi sir,
Thanks for your reply,
But where i have to set index,??
nnd what i have to set.??
Thanks
Raj
|
|
|
|
|
just set the cbo.selectedIndex = 1 (this will select the text of the index 1). You will decide which index you want to load / show first.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
thank you dear..
What rule is appropriate in the Sugeno method ?
|
|
|
|
|
I suggest you read this[^]. Then you can come up with your code and actually ask about specific problems.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
In his defence, I think he pressed the wrong button and posted it as a new message, rather than a reply - he subsequently posted it as a reply to a request for more information I made a week ago.
So not a lot of use either way, really!
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Hi sir,
I am trying to edit in the ComboBox.
Every time the focus is setting to start position
For Example:
If i enter first character as "P"
then if i type the second character "a"
It is coming before "p" as "ap"
But i want it as "pa"
Any idea will be helpful.
Thanks
Raj
|
|
|
|
|
when you set focus on combobox ??
Are you setting focus on any key event ??
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I guess RightToLeft property is set to true. Make it false and things would work as you want.
|
|
|
|
|
Pardon me if I'm a little vague - I know what I want to do, but I'm not certain it's possible.
I want to build a control that can be set at design time to use different data types. My first attempt, now that I look at it from a distance, is obviously not going to work. To wit:
public SByte DataValue
{
get { return SByte.Parse(this.Text); }
set { this.Text = value.ToString(); }
}
public Int16 DataValue
{
get { return Int16.Parse(this.Text); }
set { this.Text = value.ToString(); }
}
While it doesn't produce any syntax errors, it gives the compiler heartburn. I was thinking that I can have multiple methods of the same name but different types, but since the signature is the same for both methods, it creates ambiguity.
In the class declaration I've included an enum type and member to contain the types I want to be able to use this control with, and my thought was to make the type changeable at design time by changing the DataType property in the Designer, so that the same control could be used to collect different types of data. This would be set in the VS Designer as a Property of the control. The parent form for the control would be responsible for keeping track of which data type each instance of the control uses, but it would be freed from the task of converting inputs to the correct type and performing validation for each type, that being delegated to the control, itself.
My initial approach is clearly bogus, but I still think that it should be possible to do. My understanding of generic classes and methods is thin, but I suspect that I should be looking there for a solution. Can anyone suggest a smarter way to tackle this problem?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|