|
|
Hi,
the params keyword tells the compiler it should collect the remaining arguments and turn them into an object array; yes, you can use params with a delegate; here is an example:
delegate void TestDelegate(params object[] list);
event TestDelegate aha;
public override void Test(int arg) {
aha+=new TestDelegate(showArgCount);
aha.Invoke(1);
aha.Invoke(1, 2, 3, 4);
}
public void showArgCount(object[] args) {
log("showArgCount: "+args.Length);
}
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:41 AM
|
|
|
|
|
Thank you for your help and I will try to have it more together on my next question. Please understand that my boss is asking me to do something very difficult and pushing me to get it done. I am under a lot of pressure and I did spend a lot of time doing research without luck. It has been a tough morning. The bottom line is that I am sorry for the question.
Steve
|
|
|
|
|
You're welcome.
And I saw nothing wrong with your question.(if I did, I would have told you!)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hi friends am using usercontrol as drawing area to draw graphics...so now i want to apply zoom factor to usercontrol(not to image)...plzzzzzz help me..
txs in advance...
|
|
|
|
|
usercontrol zoom? Basically this will increase/decrease the size of the control?
why do you want to do that? what controls is your usercontrol containing?
you cannot apply zoom transformations on controls, at least in standard windows applications.
You may use a workaround, to apply a zoom factor to the size/location of each children controls.
Calin
modified on Thursday, February 26, 2009 11:31 AM
|
|
|
|
|
iam drawing shapes using graphics..so i want to apply zoomfactor to dt usercontrol...
|
|
|
|
|
Hi
1. How can I show and edit, Crystal report in wideness
(in C# code)
2. Is it posible to put water stamp Logo that will be in page size ?
thank's
|
|
|
|
|
E_Gold wrote: 1. How can I show and edit, Crystal report in wideness
in wideness? Really, that's the best you could do?
Maybe you should look into this[^]
|
|
|
|
|
I've never used Crystal Reports, but the terms you were looking for are:
1. Landscape
2. Watermark
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
i'll ask again
I am looking for a way to include a watermark in a report.
Does anyone have any ideas?
|
|
|
|
|
E_Gold wrote: Does anyone have any ideas?
Actually, I do have an idea[^]
I know, I'm absolutely brilliant! For my next feat I am thinking of performing brain surgery while disarming a nuclear weapon both during a skydiving free fall.
|
|
|
|
|
I need to dynamically add a flash object to a C# desktop application. Could someone give me some overview on how to do this. I have been able to add it statically but when I go to try to create it dynamically I come up with unhandled win32 exceptions. Also I need the background to be transparent and having troubles with this too.
Thanks for any help
|
|
|
|
|
Zap-Man wrote: Also I need the background to be transparent and having troubles with this too.
Your previous posting of this question already received an answer to that question.
Zap-Man wrote: I come up with unhandled win32 exceptions.
Perhaps posting the exception message along with the relevant code that creates the exception might help people have some idea what the problem is. AFAIK, the members of this site are just normal humans, without any clairvoyant powers.
|
|
|
|
|
yep your right but the response did not answer my question. and if you were to read what I posted you could see that I did post with relevant code. I'm unsure of what creates the exception. its a generic error and leads to nothing to help be debug the problem.
I was hoping that maybe someone else has done somthing like this or knows of any links that my help!
|
|
|
|
|
Zap-Man wrote: and if you were to read what I posted you could see that I did post with relevant code
Maybe in your other post (I haven't checked) but not in this one. I don't know what the hell you did or how you went about doing it. I'd listen to the other reply and heed his/her advice.
|
|
|
|
|
|
Zap-Man wrote: but the response did not answer my question.
Really?
Christian Graus wrote: A flash control is not going to draw itself transparently, ever.
That's not an answer? Whatever. Good luck.
|
|
|
|
|
how to create user and set sql authentication for an existing data base programatically using c#
|
|
|
|
|
|
Hi,
I have this function in a DLL.
long MatchPage (long hImage, long hTemplateList, long *hMatch, char *szTemplate, long iMinMark, long bRegister, long *iConfidence);
Purpose
Match a filled form image to a Template from a Template List.
Parameters
hImage
Image handle of filled form
hTemplateList
Handle of the Template List.
hMatch
Handle of a Match which can be used later by JIRegionsRecognize. The handle should be free later by JIMatchFree.
szTemplate
Template file name is returned here. File name is returned without path and without file name extension.
iMinMark
Minimal confidence for a match. Legal values are 0-100. Recommended value is 15.
bRegister
If 1, the registered image is returned in hImage if matching achieved.
iConfidence
Confidence of the Match.
Import in this way:
[DllImport("image.dll")]
public static extern long MatchPage(IntPtr hImage, IntPtr hTemplateList, out IntPtr hMatch, [MarshalAs(UnmanagedType.LPStr)] StringBuilder szTemplate, long iMinMark, long bRegister, out IntPtr iConfidence);
...and call in this way:
rc = (int) MatchPage(hImage, hTemplateList, out hMatch, matchingTemplate, 25, 1, out iConfidence);
but the compiler says:"Access Violation" .
Someone can help me please?
TY
|
|
|
|
|
Hi,
Some of it looks good, some is less clear. It is always difficult to pinpoint what exactly is wrong; I tend to (1) keep data exchange simple and (2) add logging code on both sides, so I can see which arguments get accross correctly and which don't.
I do have 2 comments:
1.
a native long* can be passed as a managed out long or ref long, it does not need an IntPtr at all. The way your template has it, it is promising the managed world will receive an output pointer, which then natively would require long**
Chances are this is what is causing the error.
2.
I just don't know about szTemplate, I never use [MarshalAs(UnmanagedType.LPStr)] StringBuilder. I prefer a more verbose but easier to understand style as in:
[DllImport("image.dll")]
public static extern long MatchPage(..., StringBuilder szTemplate, ...);
StringBuilder sb=new StringBuilder(1000);
MatchPage(..., sb, ...);
string s=sb.ToString();
You must set an initial capacity, that is the size used to allocate the character buffer; and the safe way is to pass that Capacity to the native world so it won't overflow the buffer (similar to strncpy).
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:42 AM
|
|
|
|
|
Hi Luc,
you are very kind.
I think that the problem is not in the string, in another case the StringBuilder work fine. The problem is in the Ptr.
hImage comes from:
[DllImport("justicr.dll")]
public static extern long JIImageFileOpen(out IntPtr hImageFile, [MarshalAs(UnmanagedType.LPStr)] StringBuilder szFileName, long bWrite);
[DllImport("justicr.dll")]
public static extern long JIImageFileRead(IntPtr hImageFile, out IntPtr hImage);
rc = (int)JIImageFileOpen(out hImageFile, fullname, 0);
rc = (int)JIImageFileRead(hImageFile, out hImage);
rc = (int)JIImageGetInfo(hImage, out IWidth, out IHeight, out IResolution, out IBytesPerLine, fileName, out iPage);
and it works because JIImageGetInfo works.
and hTemplateList from:
[DllImport("justicr.dll")]
public static extern long JITemplateListCreate(out IntPtr hTemplateList);
[DllImport("justicr.dll")]
public static extern long JITemplateListLoad(IntPtr hTemplateList, [MarshalAs(UnmanagedType.LPStr)] StringBuilder szTemplates);
rc = (int)JITemplateListCreate(out hTemplateList);
rc = (int)JITemplateListLoad(hTemplateList, listaCompleta);
which is for you the problem in JIMatchPage???
ty very much
|
|
|
|
|
Hi Alessio,
I didn't realize, you and I had an earlier dialogue, and my message then ended on "Now the tricky part could be what comes next: how will managed code access the content of the image?". So that is what we are trying to do now
As I already said above, I don't trust or don't like the out IntPtr stuff. Let me expand on that: either you have data allocated by the managed world and you want to pass it (or a pointer to it) to the native world, so you probably would need the fixed keyword and no IntPtr, or the GCHandle class and no out/ref keywords. Or the memory gets allocated by the native world, and then the managed world must somehow either (1) adopt the thing as if it were a managed object (which it is not), or (2) create an object and copy all the data (which I typically don't like). AFAIK you will need to call some of the Marshal methods explicitly, however I can't provide any details, I never did such things since most Win32 API calls don't need it, and when I can choose (because the native code is mine too) I keep the data marshaling simple and try to allocate objects always on the managed side.
"Now the tricky part could be what comes next: how will managed code access the content of the image?"
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:42 AM
|
|
|
|
|
I have a table layout control with buttons in it's cells, if you click a button, it is supposed to disappear by setting its Visible property to false and it works fine, however, when I try to reposition the buttons in the table and click on the buttons, they do disappear but dragging the next button in the next cell to fill it's place and leave the last cell of the table empty! Beforehand, it used to disappear leaving it's cell empty and somehow I dont seem to have this facility anymore!
Please help!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|