Search Results

Search found 739 results on 30 pages for 'preprocessor directives'.

Page 15/30 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • error C2065: 'CComQIPtr' : undeclared identifier

    - by Ken Smith
    I'm still feeling my way around C++, and am a complete ATL newbie, so I apologize if this is a basic question. I'm starting with an existing VC++ executable project that has functionality I'd like to expose as an ActiveX object (while sharing as much of the source as possible between the two projects). I've approached this by adding an ATL project to the solution in question, and in that project have referenced all the .h and .cpp files from the executable project, added all the appropriate references, and defined all the preprocessor macros. So far so good. But I'm getting a compiler error in one file (HideDesktop.cpp). The relevant parts look like this: #include "stdafx.h" #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <WinInet.h> // Shell object uses INTERNET_MAX_URL_LENGTH (go figure) #if _MSC_VER < 1400 #define _WIN32_IE 0x0400 #endif #include <atlbase.h> // ATL smart pointers #include <shlguid.h> // shell GUIDs #include <shlobj.h> // IActiveDesktop #include "stdhdrs.h" struct __declspec(uuid("F490EB00-1240-11D1-9888-006097DEACF9")) IActiveDesktop; #define PACKVERSION(major,minor) MAKELONG(minor,major) static HRESULT EnableActiveDesktop(bool enable) { CoInitialize(NULL); HRESULT hr; CComQIPtr<IActiveDesktop, &IID_IActiveDesktop> pIActiveDesktop; // <- Problematic line (throws errors 2065 and 2275) hr = pIActiveDesktop.CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER); if (!SUCCEEDED(hr)) { return hr; } COMPONENTSOPT opt; opt.dwSize = sizeof(opt); opt.fActiveDesktop = opt.fEnableComponents = enable; hr = pIActiveDesktop->SetDesktopItemOptions(&opt, 0); if (!SUCCEEDED(hr)) { CoUninitialize(); // pIActiveDesktop->Release(); return hr; } hr = pIActiveDesktop->ApplyChanges(AD_APPLY_REFRESH); CoUninitialize(); // pIActiveDesktop->Release(); return hr; } This code is throwing the following compiler errors: error C2065: 'CComQIPtr' : undeclared identifier error C2275: 'IActiveDesktop' : illegal use of this type as an expression error C2065: 'pIActiveDesktop' : undeclared identifier The two weird bits: (1) CComQIPtr is defined in atlcomcli.h, which is included in atlbase.h, which is included in HideDesktop.cpp; and (2) this file is only throwing these errors when it's referenced in my new ATL/AX project: it's not throwing them in the original executable project, even though they have basically the same preprocessor definitions. (The ATL AX project, naturally enough, defines _ATL_DLL, but I can't see where that would make a difference.) My current workaround is to use a normal "dumb" pointer, like so: IActiveDesktop *pIActiveDesktop; HRESULT hr = ::CoCreateInstance(CLSID_ActiveDesktop, NULL, // no outer unknown CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pIActiveDesktop); And that works, provided I remember to release it. But I'd rather be using the ATL smart stuff. Any thoughts?

    Read the article

  • Count rows in Drupal views plugin

    - by Rimian
    I've written myself a Drupal Views row plugin and I want to count the rows so I can do something with the output every Nth row. I can do this in the plugin's preprocessor function but if it gets used more than once (in panels for example) I can't reset the counter to zero. Can someone point me in the right direction here?

    Read the article

  • Making sure a web page is not cached, across all browsers.

    - by Edward Wilde
    Our investigations have shown us that not all browsers respect the http cache directives in a uniform manner. For security reasons we do not want certain pages in our application to cached, ever, by the web browser. This must work for at least the following browsers: Internet Explorer versions 6-8 FireFox versions 1.5 - 3.0 Safari version 3 Opera 9 Our requirement came from a security test. After logging out from our website you could press the back button and view cached pages.

    Read the article

  • apache mod_proxy_html on Ubuntu ProxyHTMLEnable not working

    - by intargc
    I'm trying to use mod_proxy_html on Ubuntu which I installed from apt-get. The module is loading properly and all ProxyHTML* directives work except for the one that matters the most. When I do "ProxyHTMLEnable on" in my apache2.conf or vhost conf files, apache complains that it's an invalid directive and I must have misspelled it. Is anyone else having this issue on Ubuntu and what can be done to fix it?

    Read the article

  • Best Way to Include Debug Code?

    - by stormin986
    I am programming Android applications, and the best way here may or may not be the same as Java in general. I simply want to be able to set a debug flag that will only execute certain portions of code when it's set to true––equiv to C++ setting a preprocessor #define DEBUG and using #ifdef DEBUG. Is there an accepted or best way to accomplish this in Java? Right now I'm just going to set a variable in my Application object, but I don't imagine this is the best way.

    Read the article

  • C1083 WIN32 No such file or directory

    - by robUK
    Hello, Visual Studio C++ 2008 I have downloaded a sample project. I converted the project from VS 7 to VS 9. However, when I compile I get this error: c1xx : fatal error C1083: Cannot open source file: 'WIN32': No such file or directory Under project properties preprocessor definitions. I have WIN32 defined there. I have never had this error before. Many thanks for any suggestions,

    Read the article

  • angular custom directive required validation is not updated

    - by Wouter Willems
    i created my own directive, replacing an input field with a custom made input field. However, the validation of the required field never seems to update and instead is always false. Other directives inside my directive like ng-class do work. I have created a plunker here to show this problem: http://plnkr.co/edit/NuZNAJceL0MVX8i6RK9n?p=preview Can anybody help me out how to make sure that the required validation is properly updated?

    Read the article

  • C++ portable end of line

    - by Andrew
    Hi everyone, is there any way to automatically use correct EOL character depending on the OS used? I was thinking of something like std::eol? I know that it is very easy to use preprocessor directives but curious if that is already available.

    Read the article

  • IOS Paypal Phonegap Plugin errors

    - by Paul
    I'm trying to implement the Paypal Plugin for Phonegap (Iphone) - (https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/PayPalPlugin). I've followed all the instructions but I get thefollowing error on build from the SAIOSPaypalPlugin.h file - Lexical or Preprocessor issue - PGPlugin.h not found I'm using latest Cordova version freshly downloaded from Phonegap site just weeks ago, so I'm not sure whats missing?

    Read the article

  • How can I have a web link perform an action in a specific desktop application?

    - by John
    The specific situation is I have a .zip file that I want to open with a certain application. However, I don't want all ZIP files associated with that application. I think the answer is that instead of saying, "download this zip file, and open it with application X" I could have the browser basically go well my desktop application to go fetch it on its own (the same way directives like itunes: mailto: or aim: do things like launch the itunes store, add buddies, etc). Thoughts?

    Read the article

  • Conditionally compiling entire namespaces - C#

    - by Filip K
    Hi there, I was wondering if there is a way to conditionally compile entire namespaces in C#. Or am I left with having to explicitly decorate each source file within the namespace with the preprocessor directives to exclude it? In sub-versions of my application the code in various namespace is simply not required and I would like it excluded. Thanks in advance!

    Read the article

  • Setting the content-type of a response in Struts2

    - by Thomas
    So, I'm using freemarker templates with Struts2 to formulate my responses. However, since I'm trying to use taconite as well, I need the response to be sent with the content type of "text/xml". I can't seem to find a way to use freemarker directives to set the content type, and I am not well versed enough in struts to know if there is a way to do it through that. So, how should I go about this?

    Read the article

  • Visual Studio C#: Why is a "using" directive insufficient for some libraries?

    - by JYelton
    Scenario: I needed to add HttpUtility to my project, and I started by adding "using System.Web" to my collection of using directives. However the HttpUtility class would still not resolve, and I discovered (via this question) that I needed to add a reference to my project. Question: Why do I need to add a reference to this library when for most other classes a "using" directive will suffice?

    Read the article

  • Checking type sizes in C with macros.

    - by Seisatsu
    I'm writing a program that needs to have unsigned types with definite sizes. I need a uint8, uint16, uint32, and uint64, and I need them defined in types.h, in a way that they will always be defined correctly regardless of platform. My question is, how can I check the sizes of different types on each platform using preprocessor macros, so that I can define my custom types correctly in the types.h header?

    Read the article

  • A way to automatically organize #imports in Xcode

    - by Arrel
    I love the "Organize Imports" command in Eclipse to implicitly add and remove classes imported into a source file (as in Java or ActionScript). Is there a command in Xcode to update the #import directives at the top of.m Objective-C files based on the classes referenced within the file?

    Read the article

  • Understand link redirect

    - by Andrew
    wordpress placed into category 'blog' there are no subcategory 'contact' into category 'blog', neither .htaccess with redirect directives. How I can find what script does executed? and I VERY want understand how server find it. http://domain.com/freeaccess/blog/contact Thank you!

    Read the article

  • gcc check if file is main (#if __BASE_FILE__ == __FILE__)

    - by Marcin Raczkowski
    Hello. In ruby there's very common idiom to check if current file is "main" file: if __FILE__ == $0 # do something here (usually run unit tests) end I'd like to do something similar in C after reading gcc documentation I've figured that it should work like this: #if __FILE__ == __BASE_FILE__ // Do stuff #endif the only problem is after I try this: $ gcc src/bitmap_index.c -std=c99 -lm && ./a.out src/bitmap_index.c:173:1: error: token ""src/bitmap_index.c"" is not valid in preprocessor expressions Am I using #if wrong?

    Read the article

  • sizeof, size_t and dtddef.h

    - by yCalleecharan
    Hi, if I'm using the sizeof operator and making use of size_t in my code, do I have necessarily have to include the preprocessor directive stddef.h ? I haven't included the stddef.h and my code compiles without warning with both MVS2008 and with Borland C++ BuilderX. Thanks a lot...

    Read the article

  • CSS Compressor with @include support

    - by Michael
    Is there any CSS compressor that supports the @include directive? I have a bunch of css files that have one main file and are linked via those @include directives. Now that I want to compress the CSS files I'm looking for a compression tool that supports that. I cannot change the original files not to use includes because those are centrally developed ones.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >