Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

alchong

@alchong
About
Posts
15
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Calling a batch file from web application
    A alchong

    Hi Yusuf, /C was the flag. I guess I'll need to figure out if I can configure impersonation properly to run net.exe & cmd.exe under the web application user credentials instead of the ASPNET account.

    ASP.NET

  • Calling a batch file from web application
    A alchong

    When I run the batch file manually it works. Also I edited my last message, but if you didn't catch it, when the batch runs from the web application, I noted that cmd.exe and net.exe run under the ASPNET user name, and do not seem to terminate. Is this something to do with my configuration? I thought I setup impersonation properly.

    ASP.NET

  • Calling a batch file from web application
    A alchong

    Hi Yusuf, I didn't realize that the rest of the "net use X:" line got hidden because the editor thought it was html because I placed it between brackets. What I meant to say is: net use X: <some network resource path> I didn't review my post closely enough. Apologies! and update of my troubleshooting, when I look at the task manager on my computer, I see that when the batch file executes, cmd.exe and net.exe run under the ASPNET user name. I'm not sure why this is, since I set up impersonation, perhaps I'm missing something in my configuration?

    modified on Thursday, April 9, 2009 12:03 PM

    ASP.NET

  • Calling a batch file from web application
    A alchong

    Greetings... I'm currently working with IIS 5.1, developing a web app using C#, and testing on win xp pro. One of the functions of the web app is to map a drive letter to a network resource. The way I'm going about this is calling a batch file from the application: System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false; proc.StartInfo.FileName = @"C:\tmp\testBat.bat"; proc.Start(); The batch file contains the following: copy "C:\tmp\src\test.txt" "C:\tmp\dst\testcopy4.txt" net use X: I've setup impersonation in web.config, and am only using Integrated Windows Authentication in the web app. I also mapped the .bat extension to cmd.exe. When I click the button that's associated with calling the batch file, I can see that the file copy works, but nothing happens with the drive mapping command. (this is accomplished by checking whether the directory exists elsewhere in the code). Any ideas? I hope I posted this to the right place. I'm wondering if it has something to do the particular executable...

    ASP.NET

  • Visual c++ in managed environment with Framework and no visualstudio
    A alchong

    One thing you can look at to troubleshoot this issue...use depends.exe to see what dependencies you have in your dll. If you suspect it might be the framework, perhaps look at the runtime libraries like MSVCR80.dll to see what versions are on your dev system vs your deployment system. Also, you didn't really provide much information, so I'm not sure if anyone can really provide much feedback.

    COM csharp c++ help visual-studio sysadmin

  • Releasing CComPtr
    A alchong

    I see, by assigning it to NULL, that forces the release on the currently held interface, correct? Thanks for the extra tip!

    COM question com performance help announcement

  • Using C# and COM to connect to a Server
    A alchong

    This article may help: http://www.codeproject.com/KB/cs/usecomappincs.aspx[^]

    COM csharp c++ com sysadmin help

  • Releasing CComPtr
    A alchong

    Well, I have a question about the usuage of CComPtr, but I think I know the answer, but would like to make sure I understand this completely... CComPtr is a smart pointer class for managing COM interface pointers, thus I don't need to worry about calling AddRef for Release methods, since they are automatically called. From what I've read, the Release method will be called when the CComPtr goes out of scope. I'm have the task of maintaining a COM client app (first time with COM) and I was thinking about 'reusing' a particular instance of a CComPtr (no need to declare a new one, since there's one already!) The only thing that had me worried what that by reusing the CComPtr does that screw up the reference counting and create a memory leak... psuedocode below: { CComPtr myIsomething = (some Isomething interface) ...do stuff to the CComPtr... ...lets reuse it... myIsomething = (some other Isomething interface) } Since the myIsomething didn't go out of scope when I set "myIsomething" to another interface, I was worried that it may be an issue. So after a day of digging around this is my conclusion: This is actually OK, since if we look at the definition of this template, the = operator is overloaded as such: T* operator=(T* lp) { return (T*)AtlComPtrAssign((IUnknown**)&p, lp); } When I looked up AtlComPtrAssign, it seems that it will call release on the interface pointer, prior to reassignment to the new interface. If that's true, there shouldn't be any issues with reference counting and I can continue on my merry way?

    COM question com performance help announcement

  • CoCreateInstance
    A alchong

    Hmm, never came back to this, there were so many things running on this particular box, it was resource related.

    COM com sysadmin performance help question

  • CoCreateInstance
    A alchong

    For a while my code has been running fine on a server, but for the last week it's been failing consistently. I started debugging and found out that it's failing when I call CoCreateInstance. The error code returned is: 0x8007000E When I looked it up, the corresponding message is: "Not enough storage is available to complete this operation." What does this really mean? I looked at the server and there seems to be plenty of free memory (RAM) for applications. I'm fairly new to COM, but from what I understand, this method is called to create an object using a Class ID or Program ID (from MSDN), I've tried this app on another server and it seems to work. I'm fairly new to COM, so any information you can share would be helpful.

    COM com sysadmin performance help question

  • NFS mount via C++?
    A alchong

    Thanks for the quick reply, I was thinking about just invoking the executable from an app. I curious if anyone knew if there were any standard WIN32 API that was available.

    C / C++ / MFC c++ sysadmin windows-admin question

  • NFS mount via C++?
    A alchong

    David, thanks for the response, I think my question may have been too brief, and I think I should explain what I want to do. Basically there are some shares on a Unix machine that I would like to look at and determine the contents. Currently we run a batch file that maps these shares to a drive letter (on a windows box) I'd like to just automate that and add extra code to do some reporting on the file contents. I was hoping to do this in C++, and that some library out there existed that I could use to map these unix shares. I'd eventually like to make it a web service, but that is the next challenge.

    C / C++ / MFC c++ sysadmin windows-admin question

  • NFS mount via C++?
    A alchong

    Yes that's correct, I would like to access it by UNC. Currently we have a batch file that calls some executable nfs.exe ( I think it's a hummingbird's ) which mounts unix shares, which allows us to see those shares from a windows box.

    C / C++ / MFC c++ sysadmin windows-admin question

  • NFS mount via C++?
    A alchong

    I'm thinking about writing an application to access some unix shares from a windows server, is it possible to create an NFS mount in C++?

    C / C++ / MFC c++ sysadmin windows-admin question

  • MFC regular DLL using shared MFC DLL module definition file (.def) question
    A alchong

    I'm learning how to build DLLs, and I've had some observations, and I was wondering if someone could provide me some insight. In Visual Studio 2005: 1) Created a new project 2) Using the project wizard created a MFC regular DLL using shared MFC DLL. (no other options selected) 3) Added a method to the default class generated by the wizard called "Execute" void Execute(); 4) Defined the method void CTestApp::Execute() { return; } Added the method for export in the module definition file (.def) LIBRARY "Test" EXPORTS Execute When I compile I get a link warnings/error: 1>Test.def : warning LNK4022: cannot find unique match for symbol 'Execute' 1>Test.def : warning LNK4002: "public: void __thiscall CTestApp::Execute(void)" (?Execute@CTestApp@@QAEXXZ) defined in .\debug\Test.obj 1>Test.def : warning LNK4002: "public: void __thiscall CDaoDatabase::Execute(unsigned short const *,int)" (?Execute@CDaoDatabase@@QAEXPBGH@Z) defined in C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib 1>Test.def : warning LNK4002: "public: void __thiscall CDaoDatabase::Execute(wchar_t const *,int)" (?Execute@CDaoDatabase@@QAEXPB_WH@Z) defined in C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib 1>Test.def : warning LNK4002: "public: virtual void __thiscall CDaoQueryDef::Execute(int)" (?Execute@CDaoQueryDef@@UAEXH@Z) defined in C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib 1>Test.def : error LNK2001: unresolved external symbol Execute 1>C:\Documents and Settings\fi507c\My Documents\Visual Studio 2005\Projects\Test\Debug\Test.lib : fatal error LNK1120: 1 unresolved externals So I've come across two solutions Solution 1: Instead of using a .def file, use __declspec(dllexport) to export. This solution makes sense, since it automatically creates the .def file for me. But I'm not sure what the issue with the .def file was. Was it due to name decoration? Solution 2: Instead of calling my method Execute, call it something different, like Axecute. This is somewhat odd to me, just by renaming the method to something else, the .def file works to export the function. Does it have to do with the some of the linker warning/error information? Wouldn't name decoration still cause an issue?

    C / C++ / MFC help question csharp c++ visual-studio
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups