<< < 11 12 13 14 15 16 17 18 19 20 21 > >>   Sort: Rank

How can I find the day of the week given the date?
How can I find the day of the week given the date? Here are three methods: 1. Use mktime or localtime # . Here is a code fragment which computes the day of the week for February 29, 2000: #include &lt;stdio.h> #include &lt;time.h> char *wday[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "...
2015-01-07, 1175👍, 0💬

Was 2000 a leap year?
Was 2000 a leap year? Q: Is (year % 4 == 0) an accurate test for leap years? (Was 2000 a leap year?) A: No, it's not accurate (and yes, 2000 was a leap year). The actual rules for the present Gregorian calendar are that leap years occur every four years, but not every 100 years, except that they do ...
2015-01-05, 1212👍, 0💬

Suggesting that there can be 62 seconds in a minute?
Suggesting that there can be 62 seconds in a minute? Q: Why can tm_sec in the tm structure range from 0 to 61, suggesting that there can be 62 seconds in a minute? A: That's actually a buglet in the Standard. There can be 61 seconds in a minute during a leap second. It's possible for there to be two...
2015-01-05, 1265👍, 0💬

Here is a good puzzle: how do you write a program which produces its own source code as output?
Here is a good puzzle: how do you write a program which produces its own source code as output? It is actually quite difficult to write a self-reproducing program that is truly portable, due particularly to quoting and character set difficulties. Here is a classic example (which ought to be presente...
2015-01-02, 1274👍, 0💬

What is Duff's Device?
What is Duff's Device? It's a devastatingly devious way of unrolling a loop, devised by Tom Duff while he was at Lucasfilm. In its ``classic'' form, it was used to copy bytes, and looked like this: register n = (count + 7) / 8; /* count > 0 assumed */ switch (count % 8) { case 0: do { *to = *from++;...
2015-01-02, 1408👍, 0💬

What is C language?
What is C language? The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C...
2014-12-31, 1300👍, 0💬

What is delay signing?
What is delay signing? Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be d...
2014-12-31, 2073👍, 0💬

How do I tell the client applications that are already installed to start using this new MyApp.dll?
How do I tell the client applications that are already installed to start using this new MyApp.dll? So let’s say I have an application that uses MyApp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name MyApp.dll 1.1.0.0. How do ...
2014-12-29, 1928👍, 0💬

Can you have two files with the same file name in GAC?
Can you have two files with the same file name in GAC? Yes, remember that GAC is a very special folder, and while normally you would not be able to place two files with the same name into a Windows folder, GAC differentiates by version number as well, so it’s possible for MyApp.dll and MyApp.dll ...
2014-12-29, 1879👍, 0💬

Where’s global assembly cache located on the system?
Where’s global assembly cache located on the system? Usually C:\winnt\assembly or C:\windows\assembly.
2014-12-22, 1848👍, 0💬

How can you create a strong name for a .NET assembly?
How can you create a strong name for a .NET assembly? With the help of Strong Name tool (sn.exe).
2014-12-22, 1944👍, 0💬

Where are shared assemblies stored?
Where are shared assemblies stored? Global assembly cache.
2014-12-19, 2022👍, 0💬

How can you debug failed assembly binds?
How can you debug failed assembly binds? Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.
2014-12-19, 2172👍, 0💬

How can you tell the application to look for assemblies at the locations other than its own install?
How can you tell the application to look for assemblies at the locations other than its own install? Use the directive in the XML .config file for a given application. &lt;probing privatePath=”c:\mylibs; bin\debug” /> should do the trick. Or you can add additional search paths in the Prope...
2014-12-17, 1936👍, 0💬

What’s the difference between private and shared assembly?
What’s the difference between private and shared assembly? Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.
2014-12-17, 2108👍, 0💬

Suppose I call a COM object from a .NET applicaiton, but COM object throws an error. What happens on the .NET end?
Suppose I call a COM object from a .NET applicaiton, but COM object throws an error. What happens on the .NET end? COM methods report errors by returning HRESULTs; .NET methods report them by throwing exceptions. The runtime handles the transition between the two. Each exception class in the .NET Fr...
2014-12-15, 1737👍, 0💬

Can you inherit a COM class in a .NET application?
Can you inherit a COM class in a .NET application? The .NET Framework extends the COM model for reusability by adding implementation inheritance. Managed types can derive directly or indirectly from a COM coclass; more specifically, they can derive from the runtime callable wrapper generated by the ...
2014-12-10, 1811👍, 0💬

I want to expose my .NET objects to COM objects. Is that possible?
I want to expose my .NET objects to COM objects. Is that possible? Yes, but few things should be considered first. Classes should implement interfaces explicitly. Managed types must be public. Methods, properties, fields, and events that are exposed to COM must be public. Types must have a public de...
2014-12-10, 1837👍, 0💬

Can you retrieve complex data types like structs from the PInvoke calls?
Can you retrieve complex data types like structs from the PInvoke calls? Yes, just make sure you re-declare that struct, so that managed code knows what to do with it.
2014-12-08, 1785👍, 0💬

How do you call unmanaged methods from your .NET code through PInvoke?
How do you call unmanaged methods from your .NET code through PInvoke? Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.
2014-12-08, 1907👍, 0💬

I can’t import the COM object that I have on my machine. Did you write that object?
I can’t import the COM object that I have on my machine. Did you write that object? You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object. The answer to (5) is o...
2014-12-04, 1951👍, 0💬

How do you generate an RCW from a COM object?
How do you generate an RCW from a COM object? Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.
2014-12-04, 1941👍, 0💬

So can a COM object talk to a .NET object?
So can a COM object talk to a .NET object? Yes, through Runtime Callable Wrapper (RCW) or PInvoke.
2014-12-02, 1767👍, 0💬

Are COM objects managed or unmanaged?
Are COM objects managed or unmanaged? Since COM objects were written before .NET, apparently they are unmanaged. Any code not written in the Microsoft .NET framework environment is UNMANAGED. So naturally COM+ is unmanaged because it is written in Visual Basic 6.
2014-12-02, 2001👍, 0💬

<< < 11 12 13 14 15 16 17 18 19 20 21 > >>   Sort: Rank