I'm working with MS Excel interop in C# and I don't understand how this particular line of code works:
var excel = new Microsoft.Office.Interop.Excel.Application();
where Microsoft.Office.Interop.Excel.Application is an INTERFACE defined as:
[Guid("000208D5-0000-0000-C000-000000000046")]
[CoClass(typeof(ApplicationClass))]
public interface Application : _Application, AppEvents_Event
{
}
I'm thinking that some magic happens when the interface is decorated with a CoClass attribute, but still how is it possible that we can create an instance of an interface with a new keyword? Shouldn't it generate a compile time error?
I was working on a program today and hit this strange bug. I had a UIButton with an action assigned. The action was something like:
-(void) someaction:(id) e
{
if ([e tag]==SOMETAG)
{
//dostuff
}
}
What confuses me is that when I first wrote it, the if line was
if (e.tag==SOMETAG)
XCode refused to compile it, saying
error: request for member 'tag' in 'e', which is of non-class type 'objc_object*'
but I thought the two were equivalent.
So under what circumstances are they not the same?
hi,
what's the best way to customize html-css tooltips ? (I mean an easy cross-browser solution).
I need to reduce the fade-in delay and change the style. (also, could you suggest a good jQuery plug-in for it ?
thanks
Assuming a very simple program that:
-ask a name.
-store the name in a variable.
-display the variable content on the screen.
It's so simple that is the first thing that one learns.
But my problem is that I don't know how to do the same thing if I enter the name using japanese characters.
So, if you know how to do this in C++, please show me an example (that I can compile and test)
Thanks.
Normally you would use a pointer as such:
IMemLoc *loc = (IMemLoc*) new MemLoc(/* OFFSET */);
HexScale *hexBaseScale = new HexScale(0x?????, 10);
loc->scale(hexBaseScale);
But this syntax is much cleaner, notice how we can scale easier:
MemLoc *d = new MemLoc(/* OFFSET */);
(*d).scale(new HexScale(0x?????, 10))
both of these will compile just a simple example, you know
This code, when built in .Net for Any CPU platform and running on a 64-bit machine, simply returns a DialogResult of Cancel without showing the expected dialog box.
Dim dlg As New System.Windows.Forms.PrintDialog
If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
'... print the document '
End If
However, it works fine when the application is built for the x86 platform, and run on a 64-bit machine. How can you display the dialog with a 64-bit compile?
Hi
Complete novice question. I've used jQuery a bit, YUI not at all and know very little about it.
I work on a website thats IE specific, we're now looking at making it cross browser. jQuery seems great at hiding the differences between browsers from a javascript point of view. However in terms of css layout is it YUI that I should really be looking at?
thanks
Content of X.c:
int i;
main ()
{
fun ();
}
Content of Y.c:
int i;
fun ()
{
}
Why does these two files compile with no error ? (using GCC)
But if i use int i = 10; it prints a multiple definition error.
What is the jQuery alternative to the following JavaScript code?
var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
I believe a jQuery alternative would be more cross-browser compatible?
I'm trying to compile a program called hiQlab on OSX 10.8
g++ -g -O2 -I`echo /Users/.../Documents/hiQlab/hiqlab-2006-07-20/tools/`/lua/include -I`echo /Users/.../Documents/hiQlab/hiqlab-2006-07-20/tools/`/tolua++/include -c cscmatrix.cc
cscmatrix.cc:13:12: fatal error: 'umfpack.h' file not found
#include "umfpack.h"
but I just installed SuiteSparse through macports which includes umfpack
and umfpack.h is in fact present in default directory /opt/local/include/
do I need to add the path or something?
Thanks!
I am trying to add unit tests to my iPhone project in Xcode. Everything works, its great. Except when I am adding a class.m that uses CGRect (or other structs, CGPoint etc) to the unit test target (under "Compile Sources") - I am getting a compilation error: "'CGRect' undeclared (first use in this function)". I tried messing with my unit test target in various ways, but so far I haven't been able to get past this. What am I missing?
C doesn't have (to the best of my knowledge) overloading or templates, right? So how can a set of type-agnostic functions with the same name exist in plain ol' C? The usual compile-time trickery would involve a whole bunch of macros, wouldn't it?
i have the Code:Block ide in window.
my compiler is in linux machine that is GCC.
can i write the code in window & compile in linux with the Code:Block ide.
if i can , then how ?
if not, is there any alternative to do that.
thanks in advance for all suggestion.
Hi,
Is there a way to compile the code in such a way that we get only specific files/directory in out folder rather than the whole out directory.
what if i want to get only symbols directory specific to the target without host directory in it.Is it possible?
Hello,
I am in need of a reliable UDP library. The one I wrote does not work too well and I would like to see what a 3rd party can do in the same circumstances.
Enet will not work because of some "interesting" compile issues in xcode (I have another question on stack overflow about that).
Any suggestions for a portable, reliable UDP library would be greatly appreciated.
Hi Guys,
I have a,
int main (int argc, char *argv[])
and one of the arguements im passing in is a char. It gives the error message in the title when i go to compile
How would i go about fixing this?
Regards
Paul
I have various VB6 projects I'm maintaining with some of the queries being passed to the server having "ELSE:" with the colon used in case statements.
I'm wondering can someone tell me what the **ll the colon is used for? It causes errors in SQL2005 and greater, but SQL2000 works with no complaints.
I'd like to just remove it from the code & re-compile, but I'm afraid it'll break 10 other things in the application..
Thanks in advance...
Hello,
In my gtk+ application i have following code:
G_DEFINE_TYPE(PicFile, pic_file, G_TYPE_OBJECT)
When i try to compile it i see error:
error:invalid application of sizeof to incomplete type 'PicFileClass'
Where PicFileClass -
typedef struct _PicFileFileClass PicFileClass;
struct _PicFileClass {
GObjectClass parent;
};
What's wrong?
Thank you.
In some library I'm using (written in C) its
StorePGM(image, width, height, filename)
char *image;
int width, height;
char *filename;
{
// something something
}
All functions are defined this way. I never seen such function definitions in my life. They seem to be valid to MSVC but when I compile it as C++ it gives errors.
What is it? some kind of old version C?
I'm working at a java application that performs some xslt transformation.
I would like to match nodes into the xslt document, using a parameter provided by java.
Which is the right way to do something like:
<xsl:template match="//m:properties/*[contains($pattern,name())]">
because when I launch my application, it claims it's not able to compile the stylesheet, since pattern is not defined but I'm setting it using the setParameter method and I was able to use another parameter defined in the same way but in a different context.
Thanks in advance
Fil
public static void main(String[] args) {
int x = 1 + + + + + + + + + 2;
System.out.println(x);
}
I can compile above method. Is there any explanation about the allowed multiple "+" operator?
I do not know much about Haskell, but from what I have read about the mutability of computations (e.g: functions returning functions, complex monads and functions, etc.) it seems like you can do a lot of meta-programming, even at runtime.
How can Haskell, if everything like functions and monads are so complex, compile to machine code and retain all this?