|
If I set Panel.AutoScrollPosition=blah blah blah right after the control is created, the scrollbars don't budge. But if I set the property as part of the OnPaint, they work fine. What's going on? All I'm trying to do is center the scrollbars when the control is created. I don't want to code a one-time "if" statement in the OnPaint!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator.
|
|
|
|
|
Marc Clifton wrote:
I don't want to code a one-time "if" statement in the OnPaint!
Its only another if, yeah I hate them too, but thats what they there for! Unless you can do a switch perhaps?..
Cheers
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
We have a manual process today where we do the following steps:
Take an XML file and create its' schema using XMLSpy.
We take the schema and treat this as a file-by-example and apply a transform against this file to create an object definition file. (which eventually runs through my wizard to create all the class libraries to access and update the original XML file)
I coding the frontend of the wizard mentioned above to transform the XSD file into our object definition file. In the framework all of the overloads for doing an XSLT transform put the document either through an XML Reader or starts with an XML Document -- which causes an XSD file to fail because it executes an XML validator. The transform method does not let me take in the XSD file as input and no overload supports taking an XSD file as input!!!!
Does ANYONE have a suggestion on how to execute an XSLT transform against a schema file!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
....just an added piece of input:
if anyone even knows how to invoke an xml.Transform() call with the xml validator turned off even THAT may get me past this problem!!
Thanks.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
This should be an easy question. I have a pointer to memory (a DIB), and I'm wanting to copy that memory to a Bitmap.
So, the second to the last line needs to copy from a IntPtr to an IntPtr. Problem is that Marshal.Copy will convert anything to a IntPtr, or an IntPtr to anything, but it won't copy from an IntPtr to an IntPtr.
So, how are you supposed to copy from one pointer to another?
Thanks!! Rectangle rcImage = new Rectangle( 0, 0, iWidth, iHeight );
m_CurrentImage = new Bitmap( iWidth, iHeight, PixelFormat.Format8bppIndexed );
BitmapData pBitmapData = m_CurrentImage.LockBits( rcImage, ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed );
Marshal.Copy( hDibBitmap, pBitmapData.Scan0, 0, iWidth * iHeight );
m_CurrentImage.UnlockBits( pBitmapData );
|
|
|
|
|
psdavis wrote:
So, the second to the last line needs to copy from a IntPtr to an IntPtr. Problem is that Marshal.Copy will convert anything to a IntPtr, or an IntPtr to anything, but it won't copy from an IntPtr to an IntPtr.
So, how are you supposed to copy from one pointer to another?
Why on earth do you wanna do that? Why not just use the pointer?
OK I see what you are trying to do...perhaps Marshalling is NOT what need. Also you lock the memory as ReadOnly, then try to copy to it.... something strange! I have not worked with this before but AFAI can see you mite need to use ImageLockMode.UserInputBuffer...
Cheers
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
Because Microsoft told me to!!
In general, you may take the following steps to create a Bitmap from a DIB with GDI+:<br />
<br />
1. Create a Bitmap<br />
2. Lock a rectangular portion of this bitmap and provide a temporary buffer <br />
via the LockBits method<br />
3. Copy the memory from DIB<br />
4. Unlock the Bitmap<br />
<br />
-- Microsoft Pseudo-Tech Support
I've read about 20 posts on how to create a Bitmap from the old traditional DIB and they always say about the same thing. My application is trying to convert a Twain DIB to a bitmap without saving/loading the image.
And you were right about the ReadOnly flag. I hadn't gotten it to compile enough to test it.
A lot of people are apparently having the same issue with the TWAIN support. .NET Twain Image Scanner
|
|
|
|
|
Sounds to me like you want to use the InteropServices and DllImport the CopyMemory function (from Kernel32.dll I think).
John :D
|
|
|
|
|
DOH!!! I am so nearsighted on the issue, I keep forgetting you can access the API directly.
I was so concentrating on trying to get Marshal to work since it has like 28 friggin overrides.
Thanks John!
|
|
|
|
|
John Fisher wrote:
Sounds to me like you want to use the InteropServices and DllImport the CopyMemory function (from Kernel32.dll I think).
Grr, I was just gonna sugest that! But his reply gave me a hunch to fix a small problem I have had for a long time
Cheers
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
Well, if it makes you feel any better leppie, no success yet.
On the 'CopyMemory' step, getting 'object reference not set to an instance of an object' and no clues atm.
[DllImport("kernel32.dll", EntryPoint="RtlMoveMemory")]<br />
internal static extern void CopyMemory( IntPtr Destination, IntPtr Source, int Length );<br />
<br />
.....<br />
<br />
Rectangle rcImage = new Rectangle( 0, 0, iWidth, iHeight );<br />
<br />
m_CurrentImage = new Bitmap( iWidth, iHeight, PixelFormat.Format8bppIndexed );<br />
<br />
BitmapData pBitmapData = m_CurrentImage.LockBits( rcImage, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed );<br />
<br />
CopyMemory( pBitmapData.Scan0, hDibBitmap, iWidth * iHeight );<br />
<br />
m_CurrentImage.UnlockBits( pBitmapData );
|
|
|
|
|
Finally have some success. Thanks guys!!
I just needed to Lock my source pointer and it's working 'ok' at this time. Still gotta flip the memory upside down and ignore the headers.
|
|
|
|
|
I have a Web Service that I've created called CreditSearch. This Web Service has a single exposed method called Search that returns the requested individual's credit in an XML-formatted string. I then have an ASPX client that calls accepts an SSN as input, calls the service's Search method and displays the results. So far, very easy.
However, I think I'm doing some steps incorrectly. What I do is build the service, run the wsdl utility to create a .cs file, copy that .cs file into the client's project and then run the client. Is this correct?
It seems that I'm supposed to - instead of manually callnig wsdl - select the Add Web Reference menu option and have it do the work for me. However, when I do that, the client code no longer builds. What am I doing wrong here?
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
Tom Archer wrote:
It seems that I'm supposed to - instead of manually callnig wsdl - select the Add Web Reference menu option and have it do the work for me. However, when I do that, the client code no longer builds. What am I doing wrong here?
Did you add "using statement" to the client code?
After we add Web reference, we must add using statement by hand.
For example, using servicename.host_name.
"using Search.localhost".
Please, don't send me your email about your programming questions directly.
However, if you believe that you gives me some benefits, you can send me your email.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
If only it were that simple. For some reason, the reference file being generated contains an empty class with its public members not showing up.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
I found the problem. Properties that are to be exposed by marshalled objects cannot be read-only or they won't be exposed via the WSDL. This is because of some lame rule that the serializer imposes. Get this, though. The set method can be blank meaning that we're forced to include a method that does absolutely nothing in order to make the compiler happy
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
I came across the same problem today with the XMLSerialiser... But in an attempt to deserialise the object (in my case quite complex) failed...
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
1. (The probably ridiculous question Can a Panel be on one thread, and it's parent Form be on another?
2. I want my app to have two threads- main and worker. How do I stop the worker thread from ending while its waiting for stuff to do? Do I actually have to make some kind of hackish while(true) loop while it's waiting for something to do. If I do that, and then the main Thread calls one of the workers's functions via a delegate, then how do I make it escape the while loop to do it's work?
I mean, the main thread in a normal app doesn't need anything like that in it, it just stays alive waiting for events until the user exits the app. Its not like we do void Main{while(true) listenforevents();} you what I mean? Is there a Thread.ListenForEvents=true so that it won't die?
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
well I answered my first question!
System.ArgumentException: Controls created on one thread cannot be parented to a control on a different thread.
still don't know my other question tho
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Bog wrote:
well I answered my first question!
System.ArgumentException: Controls created on one thread cannot be parented to a control on a different thread.
Not really answered but more of a description to the problem! I sat with this for ages (2 - 3 weeks) when I started C#. The solution is to invoke the method than rather calling it directly. Then this opertion is perfectly allowable!
Cheers
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
Hi!
how can I draw a colored text in a RichTextBox?
thanks
|
|
|
|
|
Use RichTextBox.SelectionColor property
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
how can I remove the textselection again?
|
|
|
|
|
RichTextBox.SelectionLength = 0;
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
Hi,
How Can I check username and password of a user in Windows 2000 advanced Server? I want to check authenticate of all users of a domain, or local users of windows.
mkomasi
|
|
|
|