Search Results

Search found 159 results on 7 pages for 'precompiled'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Including a pyd directly in a setup.py file

    - by Philippe Beaudoin
    I have a complex build process to generate a couple of python extension modules (.pyd). I want to include these in my setup.py for use with distutils. The distutils page talks in length about how to add extension modules from source, but I'd want to simply package these precompiled .pyd. What is the best practice to do this? Eventually, I'd also like to freeze everything in an executable with py2exe. Will I be able to do this if I directly specify the .pyd?

    Read the article

  • Calling a running C# application from VBA

    - by Robert
    I have some VBA code that needs to talk to a running c# application. For what it's worth, the c# application runs as a service, and exposes an interface via .net remoting. I posted a question regarding a specific problem I'm having already (http://stackoverflow.com/questions/2556163/from-vb6-to-net-via-com-and-remoting-what-a-mess) but I think I may have my structure all wrong... So I'm taking a step back - what's the best way to go about doing this? One thing that's worth taking into account is that I want to call into the running application - not just call a precompiled DLL...

    Read the article

  • MinGW - cross compile tool - latest version?

    - by Petike
    At the MinGW download page you can download the "Cross-Hosted MinGW Build Tool" which is a shell script to build the "MinGW cross-compiler" so that you will be able to compile your programs on "Linux" to the "Windows" target. I have downloaded that script, run it and answered the interactive questions the script has asked me. I had to dowload some files from which one has name "gcc-core". And the "latest" version of the "gcc-core source code" I have found on that page, was "gcc-core-3.4.5-20060117-2-src.tar.gz" - so that "3.4.5" version. But on "Ubuntu Linux" I can download the precompiled "mingw32" package which is of the version "4.2.1". How is it possible that the "Ubuntu package" version of MinGW is newer than the one from the MinGW "homepage"? So which is the latest version of the "MinGW cross compile tool"?

    Read the article

  • Visual Studio CLR project

    - by Vit
    Hi, so I wanted to try my first CLR project in Visual C++. So I created console project, but since every tutorial I found about CLR programming was using C#, or windows forms, I just tried writing standart c++ Hello Word app using iostream (I think code isnt needed in this case) but I though it will give me some compile error, since iostream uses precompiled functions, and CLR app compiles into MSIL. I assumed that CLR programming using C++ means just using C++ syntax, but different functions for I/O and so. So, basicly, what I want to ask is, can any native console C++ app be compiled into MSIL and run by .NET framework?

    Read the article

  • Switching to Linux for Windows development, bad idea?

    - by krebstar
    I was contemplating switching to Linux for C++ development, coming from a Windows environment. Is this a bad idea? My workplace uses Windows and Visual Studio for our projects (some C# and java too, but right now I'm only developing in C++). If they decide to put me on a C# project, would development still possible (mono?)? What are the difficulties in this sort of transition? Would I have a problem working on their projects and vice versa? I read somewhere that there'd be problems with precompiled headers and such (we do use them), and encodings (tabs/spaces, line endings, etc).. If it's not too hard to do this switch, how do I get started? IDE? vim+make? Thanks. By the way, we make MOSTLY windows software.. EDIT: Thanks guys, I guess that makes sense..

    Read the article

  • Can a PL/pgSQL function contain a dynamic subquery?

    - by morpheous
    I am writing a PL/pgSQL function. The function has input parameters which specify (indirectly), which tables to read filtering information from. The function embeds business logic which allows it to select data from different tables based on the input arguments. The function dynamically builds a subquery which returns filtering data which is then used to run the main query. My questions are: Is it 'legal' to use a dynamic subquery in a PL/pgSQL function. I cant see why not - but this question is related to the next one. AFAIK, PL/pgSQL are cached or precompiled by the query engine. How does having a function that generates dynamic subqueries impact the work of the query engine?

    Read the article

  • link .a and .o files in GCC

    - by David
    hi! I have two precompiled library: X.a and Y.a and a test.cpp (without main function) source code use these two libraries. I compiled the C++ using: g++ -c test.cpp and I got 'test.o'. Now how can I link these three together to generate a .a file because test.cpp use some function in X.a and Y.a and other GCC libraries? BTW, I am doing these under Windows using MinGW. Can I rename this .a file to .lib and use this .lib in VC? Thanks!

    Read the article

  • How to make columns as wide as the widest entry?

    - by Helper Method
    For a gcc cheatsheet I'm writing, I want to create a table which should describe how gcc interprets different file endings. The table I created so far is defined as follows: |====================================================================== |.c |C source code which must be preprocessed. |.i |C source code which should not be preprocessed. |.h |C header file to be turned into a precompiled header. |.s |Assembler code. |other | An object file to be fed straight into linking. Any file name with no recognized suffix is treated this way. |====================================================================== The problem I have is that the table spans the total page width, but what I want is that each column only is as wide as it's widest entry, and that the table will span only as much witdh as it needs.

    Read the article

  • RubyMotion Error When Using setTranslucent

    - by Sam Morris
    I'm getting the following error when trying rake a project I'm working on, and I can't figure out why. The message happens no matter what variable I sent it. Objective-C stub for message `setTranslucent:' type `v@:c' not precompiled. Make sure you properly link with the framework or library that defines this message Here's my app_delegate file for reference. class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) navigation_appearance @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) tableView = StopsController.alloc.init @window.rootViewController = UINavigationController.alloc.initWithRootViewController(tableView) @window.makeKeyAndVisible true end def navigation_appearance UINavigationBar.appearance.setBackgroundImage UIImage.imageNamed('navbar_bg.png'), forBarMetrics: UIBarMetricsDefault UINavigationBar.appearance.setTranslucent(true) UINavigationBar.appearance.setShadowImage UIImage.imageNamed('navbar_shadow.png') end end

    Read the article

  • Visual C++ 2008: Finding the cause of slow link times

    - by ckarras
    I have a legacy C++ project that takes an annoyingly long time to build (several minutes, even for small incremental changes), and I found most of the time was spent linking. The project is already using precompiled headers and incremental compilation. I have enabled the "/time" command line parameter in the hope I would get more details about what is slowing the linker, and got the following output: 1>Linking... 1> MD Merge: Total time = 59.938s 1> Generate Transitions: Total time = 0.500s 1> MD Finalize: Total time = 7.328s 1>Pass 1: Interval #1, time = 71.718s 1>Pass 2: Interval #2, time = 8.969s 1>Final: Total time = 80.687s 1>Final: Total time = 80.953s Is there a way to get more details about each of these steps? For example, I would like to find if they are spending most time linking to a specific .lib or .obj file. Also, is there any documentation that explains what each of these steps do?

    Read the article

  • How to Create C++ Project Filter/Folder in Visual Studio?

    - by BSalita
    Using Visual Studio 2012, I'd like to create a C++ project folder called "Include Files", which has the same characteristics as the well known folder "Header Files". That is, the files in Include Files have a cpi extenson and will be parsed out for use with InteliSense, and also can be precompiled. I'm able to create the folder but files within it aren't parsed. I've tried setting the type to C++ Header file. Nothing seems to work. The files work fine when given a hpp extension and put into Header Files folder.

    Read the article

  • Visual Studio scratch disk behavior

    - by bobobobo
    I don't know if this feature exists, but I'd like a way to control Visual Studio 2010's scratch disk behavior (other than completely turning off intellisense). Right now it creates a massive .sdf file in the project folder (50MB+), and then it goes and creates an IPCH folder with 60MB+ of precompiled headers. All that's well and good while VS is running, but after it exits, I really would like the disk back. Is there a way to configure vs 2010 to Use the same location (%AppData%\VSScratch) for scratch disk files (so its easier to blow it away?) Automatically delete .sdf /ipch on exit? I know they don't delete them because its faster to startup.. but if you delete them yourself, startup time isn't that much increased..

    Read the article

  • How can I batch convert SVG files containing text to PDF files (specifically on CentOS 5.3 x86_64)?

    - by molecules
    I would like to programatically convert SVG files to PDF files. However, the SVG files contain text that must be searchable in the generated PDF files. Also, it has to work on Red Hat Enterprise Linux 5.3 or CentOS 5.3 for the x86_64 architecture. It would be nice if it were Open Source or at least not very expensive. Here is what I've tried. All of these, except Batik, work fine on Debian Lenny. Inkscape I can get it installed using autopackages from http://inkscape.modevia.com/ap, but when I use it from the command line, the text is not searchable. Batik rasterizer [sic] When it converts SVG files to PDF files, the text is no longer searchable. svg2pdf The source for this and several of its dependencies are available to download. I have been trying to get it to compile on CentOS, but haven't had success yet. I found a precompiled version for Debian x86_64, but it doesn't work on CentOS. rsvg-convert Generated PDF isn't searchable on CentOS 5.3. Perhaps installing a newer version of cairo would help. Thanks to DaveParillo for mentioning rsvg-convert (on superuser). SOLUTION (but perhaps some of the above will still be useful to the reader) princeXML It works fine on CentOS when installed from source. For some reason it doesn't work when installed from the .rpm. Thanks Erik Dahlström! (provided solution that worked for my case on stackoverflow) Cross posted on stackoverflow

    Read the article

  • Where should you put constants and why?

    - by Tim Meyer
    In our mostly large applications, we usually have a only few locations for constants: One class for GUI and internal contstants (Tab Page titles, Group Box titles, calculation factors, enumerations) One class for database tables and columns (this part is generated code) plus readable names for them (manually assigned) One class for application messages (logging, message boxes etc) The constants are usually separated into different structs in those classes. In our C++ applications, the constants are only defined in the .h file and the values are assigned in the .cpp file. One of the advantages is that all strings etc are in one central place and everybody knows where to find them when something must be changed. This is especially something project managers seem to like as people come and go and this way everybody can change such trivial things without having to dig into the application's structure. Also, you can easily change the title of similar Group Boxes / Tab Pages etc at once. Another aspect is that you can just print that class and give it to a non-programmer who can check if the captions are intuitive, and if messages to the user are too detailed or too confusing etc. However, I see certain disadvantages: Every single class is tightly coupled to the constants classes Adding/Removing/Renaming/Moving a constant requires recompilation of at least 90% of the application (Note: Changing the value doesn't, at least for C++). In one of our C++ projects with 1500 classes, this means around 7 minutes of compilation time (using precompiled headers; without them it's around 50 minutes) plus around 10 minutes of linking against certain static libraries. Building a speed optimized release through the Visual Studio Compiler takes up to 3 hours. I don't know if the huge amount of class relations is the source but it might as well be. You get driven into temporarily hard-coding strings straight into code because you want to test something very quickly and don't want to wait 15 minutes just for that test (and probably every subsequent one). Everybody knows what happens to the "I will fix that later"-thoughts. Reusing a class in another project isn't always that easy (mainly due to other tight couplings, but the constants handling doesn't make it easier.) Where would you store constants like that? Also what arguments would you bring in order to convince your project manager that there are better concepts which also comply with the advantages listed above? Feel free to give a C++-specific or independent answer. PS: I know this question is kind of subjective but I honestly don't know of any better place than this site for this kind of question. Update on this project I have news on the compile time thing: Following Caleb's and gbjbaanb's posts, I split my constants file into several other files when I had time. I also eventually split my project into several libraries which was now possible much easier. Compiling this in release mode showed that the auto-generated file which contains the database definitions (table, column names and more - more than 8000 symbols) and builds up certain hashes caused the huge compile times in release mode. Deactivating MSVC's optimizer for the library which contains the DB constants now allowed us to reduce the total compile time of your Project (several applications) in release mode from up to 8 hours to less than one hour! We have yet to find out why MSVC has such a hard time optimizing these files, but for now this change relieves a lot of pressure as we no longer have to rely on nightly builds only. That fact - and other benefits, such as less tight coupling, better reuseability etc - also showed that spending time splitting up the "constants" wasn't such a bad idea after all ;-)

    Read the article

  • MSBuild: building website using AspNetCompiler - adding references?

    - by Tom Morgan
    Hi, I'm attempting to build a ASP.NET website using MSBuild - specifically the AspNetCompiler tag. I know that, for my project, I need to add some references. Within Visual Studio I have several references, one is a project reference and the others are some DLLS (AjaxControlToolkit etc). I'm happy not referencing the project and referencing the DLL instead - however I just can't work out how to add a reference. I've looked up and down and this is what I've found so far: <Target Name = "PrecompileWeb"> <AspNetCompiler VirtualPath = "DeployTemp" PhysicalPath = "D:\AutoBuild\CruiseControl\Projects\Websites\MyCompany\2.0.0\WorkingDirectory\VSS" TargetPath = "D:\AutoBuild\CruiseControl\Projects\Websites\MyCompany\2.0.0\PreCompiled" Force = "true" Debug = "true" Updateable = "true"/> </Target> Also - I've picked up this bit of code from around the web somewhere, which I thought might help: <ItemGroup> <Reference Include="My.Web.DataEngine, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>D:\AutoBuild\CruiseControl\Projects\Components\My.Web.DataEngine\bin\Debug\My.Web.DataEngine.dll</HintPath> </Reference> </ItemGroup> What I want to do is add a attribute to the AspNetCompiler tag, something like: References="@(Reference)" but MSBuild isn't very happy about this. I've been a bit stuck in not being able to find decent references on doing this anywhere: so I'd really apprechiate some pointers or reference material etc. (or just the answer!) Thanks for you help. -tom

    Read the article

  • Improve XPath efficiency for repeated, parameterized queries

    - by Chris Allan
    Hi, I am repeatedly performing the following XPath query (though parameterized by 'keywordText') around 40,000 times: String query = SystemGlobal.YAHOO_KEYWORDSSUBNODE + "/" + SystemGlobal.YAHOO_KEYWORDNODE + "[" + SystemGlobal.YAHOO_ATTRKEYPHRASE + "='" + keywordText + "']"; CachedXPathAPI cachedXPathAPI = new CachedXPathAPI(); NodeIterator nl = cachedXPathAPI.selectNodeIterator(doc.getElementsByTagName(SystemGlobal.YAHOO_KEYWORDSROOT).item(0), query); Node n; if ((n = nl.nextNode()) != null) { keyword.setKeywordId(Long.parseLong(cachedXPathAPI.selectSingleNode(n, SystemGlobal.YAHOO_ATTRKEYID).getTextContent())); keyword.setKeyPhrase(cachedXPathAPI.selectSingleNode(n, SystemGlobal.YAHOO_ATTRKEYPHRASE).getTextContent()); keyword.setStatus(mapStatus(cachedXPathAPI.selectSingleNode(n, SystemGlobal.YAHOO_ATTRSTATUS).getTextContent())); keyword.setCampaignId(Long.parseLong(cachedXPathAPI.selectSingleNode(n, "../../" + SystemGlobal.YAHOO_ATTRCAMPAIGNID).getTextContent())); keyword.setAdGroupId(Long.parseLong(cachedXPathAPI.selectSingleNode(n, "../" + SystemGlobal.YAHOO_ATTRADGROUPID).getTextContent())); On the first run of the script, all 40,000 runs of this piece of code will have nl.nextNode() == null, and everything runs quite quickly. However, on the following runs, when nl.nextNode() != null, then things slow down a lot - this takes around an additional 40min to run (whereas the first run takes maybe 1 minute). Oh, and the doc is constructed like so: InputSource in = new InputSource(new FileInputStream(filename)); DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); doc = dfactory.newDocumentBuilder().parse(in); I tried including the following lines reportEvaluator = new XPathEvaluatorImpl(reportDoc); reportResolver = reportEvaluator.createNSResolver(reportDoc); and rather creating a NodeIterator, instead creating an XPathResult: XPathResult result = (XPathResult)reportEvaluator.evaluate(query, doc.getElementsByTagName(SystemGlobal.YAHOO_KEYWORDSROOT).item(0), reportResolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null); however this ran even slower Is there a way in which I can speed up the running of this script? I have seen references to precompiled queries, though I haven't seen many actual details. Also, as seen in the code, I am using CachedXPathAPI, though the benefit for this case is not so great. Any help is much appreciated! Chris Allan

    Read the article

  • Aspnet_merge error has no detail

    - by dang57
    I have been attempting to add a Deployment Project to my web app. When I build it, I get a message "An error occurred when merging assemblies: Exception from HRESULT: 0x806D0004". There is no other detail, like ILMerge error, or Duplicate Name. I have "verbosity" set to "Diagnostic", and this is the output: Command: C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe "\...XXX...\My Documents\Visual Studio 2005\Projects\XXX_deploy\Debug" -o XXX_deploy -debug -copyattrs The "AspNetMerge" task is using "aspnet_merge.exe" from "C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe". Utility to merge precompiled ASP.NET assemblies. An error occurred when merging assemblies: Exception from HRESULT: 0x806D0004 C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(474,9): error MSB6006: "aspnet_merge.exe" exited with code 1. Done executing task "AspNetMerge" -- FAILED. Done building target "AspNetMerge" in project "XXX_deploy.wdproj" -- FAILED. Done building project "XXX_deploy.wdproj" -- FAILED. Build FAILED. I have tried running the command via the Command prompt, but it does not give any additional information. I have also removed EVERYTHING from the project, including references, style sheets, forms, tableadapters. I still have a web.config, but deleted all app-specific lines. I added a single new form named Default. I have even tried renaming that form to DefaultX, just in case there was another Default out there. I still get the error. What else can I look for? I'm running VS 2005 v8.05. Thanks Dan

    Read the article

  • Monotouch or Titanium for rapid application development on IPhone?

    - by Ronnie
    As a .Net developer I always dreamed for the possibility to develop with my existing skills (c#) applications for the Iphone. Both programs require a Mac and the Iphone Sdk installed. Appcelerator Titanium was the first app I tried and it is based on exposing some Iphone native api to javascript so that they can be called using that language. Monotouch starts at $399 for beeing able to deploy on the Iphone and not on the Iphone simulator while Titanium is free. Monotouch (Monodevelop) has an Ide that is currently missing in Titanium (but you can use any editor like Textmate, Aptana...) I think both program generate at the end a native precompiled app (also if I am not sure about the size of the final app on the Iphone as I think the .Net framework calls are prelilnked at compilation time in Monotouch). I am also not sure about the full coverage of all the Iphone api and features. Titanium has also the advantage to enable Android app development but as a c# developer I still find Monotouch experience more like the Visual Studio one. Witch one would you choose and what are your experiences on Monotouch and Titanium?

    Read the article

  • .NET substitute dependent assemblies without recompiling?

    - by RK
    I have a question about how the .NET framework (2.0) resolves dependent assemblies. We're currently involved in a bit of a rewrite of a large ASP.NET application and various satellite executables. There are also some nagging problems with our foundation classes that we developed a new API to solve. So far this is a normal, albeit wide-reaching, update. Our heirarchy is: ASP.NET (aspx) business logic (DLLs) foundation classes (DLLs) So ASP.NET doesn't throw a fit, some of the DLLs (specifically the foundation classes) have a redirection layer that contains the old namespaces/functions and forwards them to the new API. When we replaced the DLLs, ASP.NET picked them up fine (probably because it triggered a recompile). Precompiled applications don't though, even though the same namespaces and classes are in both sets of DLLs. Even when the file is renamed, it complains about the assemblyname attribute being different (which it has to be by necessity). I know you can redirect to differnet versions of the same assembly, but is there any way to direct to a completely different assembly? The alternatives are to recompile the applications (don't really want to because the applications themselves haven't changed) or recompile the old foundation DLL with stubs refering to the new foundation DLL (the new dummy DLL is file system clutter).

    Read the article

  • How to compile a C DLL for 64 bit with Visual Studio 2010?

    - by Daren Thomas
    I have a DLL written in C in source code. This is the code for the General Polygon Clipper (in case you are interested). I'm using it in a C# project via the C# wrapper provided on the homepage. This comes with a precompiled DLL. Since switching to a 64bit Development machine with Visual Studio 2010 and Windows 7 64 bit, the application won't run anymore. This is the error I get: An attempt was made to load a program with an incorrect format. This is because of DLLImporting the 32bit gpc.dll, as I have gathered from stuff found on the web. I assume this will all go away if I recompile the DLL to 64bit, but can't for the love of me figure out how to do so. My C skills are basic, in that I can write a C program with the GNU tools, but have no experience with various compilers / processors / IDEs etc. I believe I could port this to C#. By that I mean I trust myself to actually pull it off. But I'd prefer not to, since it is a lot of work that I'd prefer a compiler to do for me ;)

    Read the article

  • Producer/consumer system using database (MySql), is this feasible?

    - by johnrl
    Hi all. I need to use something to coordinate my system with several consumers/producers each running on different machines with different operating systems. I have been researching on using MySql to do this, but it seems ridiculously difficult. My requirements are simple: I want to be able to add or remove consumers/producers at any time and thus they should not depend on each other at all. Naturally a database would separate the two nicely. I have been looking at Q4M message queuing plugin for MySql but it seems complicated to use: I have to recompile it every time I upgrade MySql (can this really be true?) because when I try to install it on Ubuntu 9.10 with MySql 5.1.37 it says "Can't open shared library 'libqueue_engine.so' (errno: 0 API version for STORAGE ENGINE plugin is too different)". There is no precompiled version for MySql 5.1.37 apparently. Also what if I want to run MySql on my windows machine, then I can't rely on this plugin as it only seems to run on Linux and OSX?? I really need some input on how to construct my system best possible.

    Read the article

  • stdexcept On Android

    - by David R.
    I'm trying to compile SoundTouch on Android. I started with this configure line: ./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host_alias=arm-eabi --no-create --no-recursion Because the Android NDK targets ARM, I also had to change the Makefile to remove the -msse2 flags to progress. When I run 'make', I get: /bin/sh ../../libtool --tag=CXX --mode=compile arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c -o FIRFilter.lo FIRFilter.cpp libtool: compile: arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c FIRFilter.cpp -o FIRFilter.o FIRFilter.cpp:46:21: error: stdexcept: No such file or directory FIRFilter.cpp: In member function 'virtual void soundtouch::FIRFilter::setCoefficients(const soundtouch::SAMPLETYPE*, uint, uint)': FIRFilter.cpp:177: error: 'runtime_error' is not a member of 'std' FIRFilter.cpp: In static member function 'static void* soundtouch::FIRFilter::operator new(size_t)': FIRFilter.cpp:225: error: 'runtime_error' is not a member of 'std' make[2]: *** [FIRFilter.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all-recursive] Error 1 This isn't very surprising, since the -nostdlib flag was required. Android seems to have neither stdexcept nor stdlib. How can I get past this block of compiling SoundTouch? At a guess, there may be some flag I don't know about that I should use. I could refactor the code not to use stdexcept. There may be a way to pull in the original stdexcept source and reference that. I might be able to link to a precompiled stdexcept library.

    Read the article

  • c++ d3d hooking - COM vtable

    - by Mango
    Trying to make a Fraps type program. See comment for where it fails. #include "precompiled.h" typedef IDirect3D9* (STDMETHODCALLTYPE* Direct3DCreate9_t)(UINT SDKVersion); Direct3DCreate9_t RealDirect3DCreate9 = NULL; typedef HRESULT (STDMETHODCALLTYPE* CreateDevice_t)(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); CreateDevice_t RealD3D9CreateDevice = NULL; HRESULT STDMETHODCALLTYPE HookedD3D9CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) { // this call makes it jump to HookedDirect3DCreate9 and crashes. i'm doing something wrong HRESULT ret = RealD3D9CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); return ret; } IDirect3D9* STDMETHODCALLTYPE HookedDirect3DCreate9(UINT SDKVersion) { MessageBox(0, L"Creating d3d", L"", 0); IDirect3D9* d3d = RealDirect3DCreate9(SDKVersion); UINT_PTR* pVTable = (UINT_PTR*)(*((UINT_PTR*)d3d)); RealD3D9CreateDevice = (CreateDevice_t)pVTable[16]; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)RealD3D9CreateDevice, HookedD3D9CreateDevice); if (DetourTransactionCommit() != ERROR_SUCCESS) { MessageBox(0, L"failed to create createdev hook", L"", 0); } return d3d; } bool APIENTRY DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID lpReserved) { if (fdwReason == DLL_PROCESS_ATTACH) { MessageBox(0, L"", L"", 0); RealDirect3DCreate9 = (Direct3DCreate9_t)GetProcAddress(GetModuleHandle(L"d3d9.dll"), "Direct3DCreate9"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)RealDirect3DCreate9, HookedDirect3DCreate9); DetourTransactionCommit(); } // TODO detach hooks return true; }

    Read the article

  • Uncaught exception while using xdebug

    - by rich97
    I'm not too great with xdebug so forgive me if this is a stupid question. But I installed it on a separate machine and it performed some magic for me like formating my var_dump() output and catching any uncaught exceptions. It also fails to format the stack traces, outputting plain text which is extremely hard to read. As I am learning the Lithium PHP Framework I am required to use php5.3, on my other machine I compiled from the source but on this machine I'm using the precompiled packages from dotdeb.org. As far as I can tell the only difference is that this is a slightly newer version of php and it comes with the Suhosin patch. The other odd thing is that the xdebug functions such as xdebug_var_dump() work, aside from poor formatting. This is an Ubuntu machine, so I don't know if it could be anything to do with the dotdep packages, but I have installed xdebug through pecl, the downloadable tarball and from the SVN repository. But to no avail. You can see my php.ini and output of php -i in the following gist. I copied php.ini from /etc/php5/apache2/php.ini over to /etc/php5/cli/php.ini so php -i should reflect my apache setup. http://gist.github.com/391675 Any help is appreciated. Rich

    Read the article

  • How to call functions inside a C dll which take pointers as arguments from C#

    - by AndrejaKo
    Hi people, this is my first post here! I'm trying to make a windows forms program using C# which will use a precompiled C library. It will access a smart card and provide output from it. For the library, I have a .dll, .lib and .h and no source. In the .h file there are several structs defined. Most interesting functions of the .dll expect pointers to allocated structs as arguments. I've been calling functions inside the .dll like this: For example function EID_API int WINAPI EidStartup(int nApiVersion); would be called like this [DllImport("CelikApi.dll")]//the name of the .dll public static extern int EidStartup(int nApiVersion); Now my problem is that I can't find equivalent of C's pointers which point to dynamically allocated structures in memory in C#, so I don't know what to pass as argument to functions which take C pointers. I don't have much experience in C#, but to me its use looked as the easiest way of making the program I need. I tried with C++, but Visual Studio 2010 doesn't have IntelliSense for C++/CLR. If you can point me to something better, feel free to do so.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >