|
|
I can reply the same thing to people voting me down: How to answer a question.[^]
It's not 100% correct to delete the message, but I did so in order to avoid discussion.
Apologies if it really is that wrong to do so.V.
|
|
|
|
|
How does this apply? The ones who marked you down were following the guidelines. You were not.
3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
4. If the question is inappropriate then click the 'vote to remove message' button I know the language. I've read a book. - _Madmatt
|
|
|
|
|
exactly, my question was certainly not poorly phrased, not inappropriate, no bad english. I certainly believed it belonged in the C# forum as it was IMO not 100% related to WPF and I was developing in C#.
There was no reason for voting me down, hence my reply to you.
Secondly, I apologized for removing the message, let's just stop the discussion and forget about it.V.
|
|
|
|
|
Fair point. There seems to be too much willingness for people to spend time quibbling about things being in the wrong place and filling the forums up with arguments rather than insightful help. Regards,
Rob Philpott.
|
|
|
|
|
You will probably get a better response in the COM forum.
It looks like the COM component (or the caller of the com component) is taking too long to respond. I don't know enough about COM to really held.Antoine de Saint-Exupery: Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
|
|
|
|
|
thanks for the reply I appreciate it (people started voting me down for what reason I don't know).
I did see the COM bit in the message, but it surprises me as I don't have any references to a COM object.
Makes me think that this error must be weird indeed.V.
|
|
|
|
|
You should only get this error when you run it through the Visual Studio debugger. Your release mode executable will not throw this error or message. Of course freezing up your main thread for over a minute may not be a good thing to do but I guess you can live with that if the user knows that it's to be expected.
See this blog entry[^] for more info on this.
Oh btw I think you posted this in the right forum. It's just that when you mentioned WPF some people got mislead (people try and answer everything here, even on topics they are not familiar with - it's a mad rush I guess to be the first one to answer. kinda keeps the forum response time fast, so it's all good I guess)
|
|
|
|
|
Thank you very much for your answer !
I'll definitely check it out.
Nishant Sivakumar wrote: Oh btw I think you posted this in the right forum.
Thanks. For a minute things where idd a little hectic, God knows why.V.
|
|
|
|
|
I am using below code to check printing status but it always returns 0. It would be great if you can help me . i think there is some problem in the way i am using GetPrinter method
[DllImport("winspool.Drv", EntryPoint = "OpenPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
private static extern bool OpenPrinter([MarshalAs(UnmanagedType.LPStr)] string szPrinter, out IntPtr hPrinter, Int32 pDefault);
[DllImport("winspool.Drv", EntryPoint = "ClosePrinter", SetLastError = true, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern bool ClosePrinter(IntPtr printer);
[DllImport("winspool.Drv", EntryPoint = "GetPrinterDataA", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
public static extern uint GetPrinterData(
[In] IntPtr hPrinter,
[In, MarshalAs(UnmanagedType.LPWStr)] string pValueName,
[Out, Optional] uint pType,
[Out, Optional] IntPtr pData,
uint nSize,
[Out] uint pcbNeeded
);
[DllImport("winspool.Drv", EntryPoint = "GetPrinterA", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern bool GetPrinter(
IntPtr hPrinter,
int dwLevel ,
IntPtr pPrinter,
int dwBuf ,
out int dwNeeded
);
[StructLayout(LayoutKind.Sequ
ential)]
internal struct PRINTER_INFO
{
public IntPtr pServerName;
public IntPtr pPrinterName;
public IntPtr pShareName;
public IntPtr pPortName;
public IntPtr pDriverName;
public IntPtr pComment;
public IntPtr pLocation;
public IntPtr pDevMode;
public IntPtr pSepFile;
public IntPtr pPrintProcessor;
public IntPtr pDatatype;
public IntPtr pParameters;
public IntPtr pSecurityDescriptor;
public uint Attributes;
public uint Priority;
public uint DefaultPriority;
public uint StartTime;
public uint UntilTime;
public uint Status;
public uint cJobs;
public uint AveragePPM;
}
[Flags]
internal enum PrinterStatus : uint
{
RS_READY = 0x00000000,
PS_PAUSED = 0x00000001,
PS_ERROR = 0x00000002,
PS_PENDING_DELETION = 0x00000004,
PS_PAPER_JAM = 0x00000008,
PS_PAPER_OUT = 0x00000010,
PS_MANUAL_FEED = 0x00000020,
PS_PAPER_PROBLEM = 0x00000040,
PS_OFFLINE = 0x00000080,
PS_IO_ACTIVE = 0x00000100,
PS_BUSY = 0x00000200,
PS_PRINTING = 0x00000400,
PS_OUTPUT_BIN_FULL = 0x00000800,
PS_NOT_AVAILABLE = 0x00001000,
PS_WAITING = 0x00002000,
PS_PROCESSING = 0x00004000,
PS_INITIALIZING = 0x00008000,
PS_WARMING_UP = 0x00010000,
PS_TONER_LOW = 0x00020000,
PS_NO_TONER = 0x00040000,
PS_PAGE_PUNT = 0x00080000,
PS_USER_INTERVENTION = 0x00100000,
PS_OUT_OF_MEMORY = 0x00200000,
PS_DOOR_OPEN = 0x00400000,
PS_SERVER_UNKNOWN = 0x00800000,
PS_POWER_SAVE = 0x01000000
}
private PrinterStatus GetPrinterStatus(string printerName)
{
PrinterStatus status = PrinterStatus.PS_ERROR;
PRINTER_INFO printer_info = new PRINTER_INFO();
Int32 error = 0, written = 0;
IntPtr hPrn = new IntPtr(0);
bool success = false;
int needed = 0;
if (OpenPrinter(printerName, out hPrn, 0))
{
GetPrinter(hPrn, 2, IntPtr.Zero, 0, out needed);
IntPtr ptr = Marshal.AllocHGlobal(needed);
GetPrinter(hPrn, 2, ptr, needed, out needed);
printer_info = (PRINTER_INFO)Marshal.PtrToStructure(ptr, typeof(PRINTER_INFO));
Marshal.FreeHGlobal(ptr);
ClosePrinter(hPrn);
status = (PrinterStatus)printer_info.Status;
}
else
{
status = PrinterStatus.PS_ERROR;
error = Marshal.GetLastWin32Error();
}
return status;
}
it would to great if you guys can help me to find whats wrong
|
|
|
|
|
Hi.
In my web site have forum.
Users can insert anything texts.I want enabled inserting just english chars and numbers, and disabled all other characters!
For example , in this forum any peoples writing native language(like arabian, parsian ,...) and how can disable it.
Thanks. We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
If you want to do that from client side you can use javascript. Try searching for regular expression validator for javascript in google. Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
I would suggest that you could have a server side filter that will only accept messsages where a certain percentage of the message conforms to your policy. But saying 'English Only' is a bad option, do you accept café? What about allat?
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
Hi.
Yep, you are right ,i need change my logic.
Thanks.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Is it possible to have a nested class like this
class a : b
{
class a
{
}
}
I am curently working in a Maintenance project, i have decompiled some dll to know the coding nature inside it, there i saw similar kind of nested class. any of you have idea on this.modified on Wednesday, February 10, 2010 7:37 AM
|
|
|
|
|
No. (As you would have found out if you had tried it.)
You can't have the same name fro a class and a class member (which the nested class is assumed to be). The compiler will complain.
You can have:
class a : b
{
class c
{
}
} If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
yes i do know that Nested class name cannot be as same as its holding class, but when i tried to Decompile a DLL it show similar kind of code inside that,
Any idea on that
|
|
|
|
|
A nested class can contain anything, methods, fields, properties, events, etc.
I think I do not understand what you are having a problem with.
Can you try explaining what you are trying to do or having a problem with in more detail, please?If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
When I publish my C# application using Visual Studio Express, and install it, it creates a ClickOnce Application Reference file on the desktop and in the Start Menu instead of just a normal .EXE file - and this is screwing up my File Associations. Could someone kindly suggest how I could have txt files etc opened in my application when dealing with Application Reference files?
Thank you
|
|
|
|
|
The real .exe file will be stored somewhere in the user's AppData folder (I think).
Why not have the associations set on first startup of the program? You could have your software enter the details in to the registry (note: potential permissions/UAC problem) as it will know exactly where it is.
|
|
|
|
|
Thank you - I have searched my entire hard drive in every possible place that there would be an executable file but have not found any. I even checked the AppData folder. Nothing at all. Just a bunch of ClickOnce Application Reference icons.
I also tried setting registry info for the associations on startup and it has been unsuccessful. I don't get any errors at all... It just doesn't work.
I've also (originally) tried using the File Association dialog that's inside the Publish page where you publish the project and entered ProgID info and icons etc and that approach hasn't worked either. But, funny thing... The custom Icons I used in the File Association dialog in VS are showing up on the files... My app just isn't loading the content of the files that are being double-clicked.
|
|
|
|
|
I have the following code:
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
string strQuery;
XmlDocument doc = new XmlDocument();
doc.Load("booksort.xml");
XmlNode book;
XmlNode root = doc.DocumentElement;
book=root.SelectSingleNode(strQuery);
}
}
In the call to SelectSingleNode, how do i formulate my strQuery so that I get the FileValue2 (in this case it is 'swethrhbfb') where FileValue1="00000002.dat"
Many thanks!
<?xml version="1.0" encoding="utf-8"?>
<MyObjects xmlns="urn:deployment-manifest-schema">
<MyObject Id="a36ef512-e9a1-48f7-9153-690f58485290" ObjectType="SPFile" ParentId="5636396a-9319-45fd-a1e0-b2eb8eb5812c" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" ParentWebUrl="esgawesodtegklas" Url="dfhgjnsdfhjdthksrtfhyasefhb">
<File Url="efhsbertyhsehgh/ryjseryghdrfh.xml" Id="a36ef512-e9a1-48f7-9153-690f58485290" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" ParentWebUrl="tjketyaehthfyh" Name="erygawrygesrfh" >
<Versions>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000000.dat" FileValue2="45tyw4trgh" FileValue3="eygegefgsd">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000001.dat" FileValue2="sertherfbf" FileValue3="ertegsrths">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000002.dat" FileValue2="swethrhbfb" FileValue3="tryeyerhrh">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000003.dat" FileValue2="drtyerysey" FileValue3="drjdrgndrg">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000004.dat" FileValue2="eryeryaery" FileValue3="rthrhsrths">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000005.dat" FileValue2="tyudtyufud" FileValue3="tyjnfghjdf">
</File>
<File Url="tukjseryhsdrtgjdtyhm" ParentWebId="db611ace-9940-4602-8f44-140fcaaa479d" Name="rfghjsetrhyusrtgbn" Id="a36ef512-e9a1-48f7-9153-690f58485290" FileValue1="00000006.dat" FileValue2="werawerase" FileValue3="gfhjndfhjd">
</File>
</Versions>
</File>
</MyObject>
</MyObjects> ----------------------------------------------------------
Lorem ipsum dolor sit amet.
modified on Wednesday, February 10, 2010 8:20 AM
|
|
|
|
|
Hi all, i need helping about
<code>if (pcap_addr.Addr != IntPtr.Zero)</</code>
is that mean (at C++):
<code>if (pcap_addr.Addr != null)</code>
|
|
|
|
|
MSDN[^] says "The value of this field is not equivalent to a null reference"
So, not quite, but similar.If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
I would read the first as there is/was "something", but it is not valid.
The second is more like, there is "nothing" or "not applicable", not applicable is even more correct I think.V.
|
|
|
|
|