User Profile

Collapse

Profile Sidebar

Collapse
allynm
allynm
Last Activity: Feb 1 '12, 11:29 PM
Joined: Apr 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Here's an answer to my own question. I use anononymous pipe to a Gnuplot process. I WriteFile the plot commands on a redirected stdin handle. It works. It's ugly, but it does work.

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <tchar.h>
    
    int _tmain (int argc, LPTSTR argv [])
    
    {
    	DWORD i;
    	HANDLE hReadPipe, hWritePipe;
    	
    	SECURITY_ATTRIBUTES
    ...
    See more | Go to post

    Leave a comment:


  • calling GNUPLOT functions with straight C from WINDOWS gui

    Hello everyone,

    I am trying to figure out how to call GNUPLOT commands from a WINDOWS app. I am not coding in C++, I'm using WINDOWS APIs.

    This is pretty straightforward problem if one is calling from a console app. Several developers (N. Devilla, for one) have done this. Their approach is to use _popen() (windows) or popen()(UNIX, LINUX). This approach doesnt work in a WINDOWS GUI app, however, only in a console...
    See more | Go to post

  • allynm
    started a topic windres syntax error
    in C

    windres syntax error

    Hello everyone,

    I am attempting to use windres to compile a .rc file. The command line I use is:

    windres -O coff about1.rc -o about1.res

    Windres generates a flurry of (more than 100) messaes each saying "warning: null characters ignored", and then ends by reporting:

    "About1.rc:1:sy ntax error"

    This same event happens even if I try to compile an empty .rc...
    See more | Go to post

  • allynm
    started a topic MinGW Console Issue
    in C

    MinGW Console Issue

    Hello everyone,

    I installed MinGW on my XP Pro box (SP 3). When I click on the MinGW shell icon, the shell console window opens briefly (about 2-3 seconds) and has a title bar, scrollbars, and frame. Then it closes and the full screen opens up with a prompt and a cursor, but nothing else--no frame, no title bar, no scrollbars. I can program the shell in this display, but it is very clumsy and just plain wierd. Can someone tell me...
    See more | Go to post

  • allynm
    started a topic Windows Named Pipes between Windows 7 and Windows XP
    in C

    Windows Named Pipes between Windows 7 and Windows XP

    Hello everyone,

    I am trying to network over a small wireless LAN a Windows 7 box and a Windows XP (SP3) box. I have written an application that uses Windows named pipes. The code appears to be bug-free (although not pretty). The problem is: The XP server box creates a named pipe but the Windows 7 box acting as client can't open the pipe. If I switch the two boxes so that the Windows 7 box acts as server and the XP acts as client,...
    See more | Go to post

  • allynm
    replied to how to use bind.exe (windows)
    in C
    Further on the subject of dynamic/static loading

    Hi Weaknessforcats ,

    Thanks for your very compact and comprehensive reply. Your description of loadlibrary/getprocaddress is spot-on. I have written exactly this kind of code for explicit linking. (for some reason, I always have to go back and teach myself about function pointers every time I do this...)

    What had prompted my interest in BIND.exe goes back...
    See more | Go to post

    Leave a comment:


  • allynm
    replied to how to use bind.exe (windows)
    in C
    Further on Bind.exe

    Hi Weaknessforcats ,

    Thanks for thinking over my query. I really appreciate your time and effort.

    I don't think bind.exe is related to preprocessing. Of course, I could be wrong. I have become extremely wary and insecure in matters of this sort.

    Bind.exe is a program available exclusively in Microsoft Platform SDK. My understanding is that it binds specific DLL exports...
    See more | Go to post

    Leave a comment:


  • allynm
    started a topic how to use bind.exe (windows)
    in C

    how to use bind.exe (windows)

    Hello everyone,

    I am unsure how to invoke bind.exe from windows platform sdk. Looking for an example. The context here is how to bind a particular DLL to a calling program. Suppose that the caller is caller.exe and the dll is ydll.dll. How would I invoke bind.exe ?

    Thanks,
    Mark Allyn
    See more | Go to post

  • How to find and READ the IMAGE_IMPORT_DESCRIPTOR structures in a WIN PE

    Hi everyone,

    I have been mucking about trying to read PE header information. I know (and use) several very nice PE dumpers, among them PEInfo. I'm trying to write C that will contain some of their functionality.

    In particular, I would like to be able to read the information in the imports section.

    I am stalled trying to find the IMAGE_IMPORT_DE SCRIPTOR structures for a test PE. My code gets me to what...
    See more | Go to post

  • Hi Weaknessforcats -

    Thanks for your response. You're line of thinking has followed my own as I was awaiting a resonse to my query.

    The motivator for the question originally was my interestin exploring the PE Header for an .exe file.

    I will try to code what I think you are suggesting. If it works, I will post on this thread.

    Thanks,
    Mark Allyn
    See more | Go to post

    Leave a comment:


  • How do I use MapViewOfFile() to read an array of structures?

    Hello everyone,

    I have written a file (using Windows WriteFile()) that contains an array of structures. The WriteFile call works fine.

    I would like to use MapViewOfFile() to read the file and pick off specific structures in the file. At this point, the code to do this first does CreateFileMappi ng() . This API call works fine for me. I then call MapViewOfFile. It returns a void ptr just as it should. My problem...
    See more | Go to post

  • Does MinGW (GCC compilers) support Microsoft Structured Error Handling (SEH)?

    Hello everyone,

    I am a very big fan of the MinGW port but ran into problems trying to write a program that used Structured Error Handling code (__Try/__Except).

    Could someone tell me whether or not MinGW (i.e. GCC compilers, either gcc or g++) support SEH?

    Thanks,

    Mark Ally
    See more | Go to post

  • allynm
    started a topic mingw ld.exe problem
    in C

    mingw ld.exe problem

    Hello everyone,

    I am trying to use the ld.exe command in MinGW to link a c program. The command line code in my makefile looks like this:

    ld -Lc:/mingw/lib -Lc:/mingw/lib/gcc/mingw32/3.4.5 $(obj) -o $(exe) \
    -lmsvcrt -lgcc -lgsl -lkernel32 -luser32

    $(obj) has been compiled with -c -v -g switches.

    What happens when I attempt to do the link is that I get an error indicating that...
    See more | Go to post

  • allynm
    replied to How to write named pipes application
    in C
    Hello Everyone,

    As often happens to me, after posting something and struggling some more, I get a solution. The answer is: Yes, you must indeed create a separate server process and a separate client process as well as a pipe connecting them. The program I wrote that does this is shown next:


    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <tchar.h>
    
    int main( int
    ...
    See more | Go to post

    Leave a comment:


  • allynm
    started a topic How to write named pipes application
    in C

    How to write named pipes application

    am a newby with Windows named pipes, and have an obviously newby question.

    The context of the program is this: I am trying to create a simple named pipe application on a single machine (no network!). A server creates a named pipe and a cllient reads/writes to the the server using a duplex pipe. The server is not multithreaded. The server has a main( ) and the client has its own main( ).

    I am having huge conceptual...
    See more | Go to post

  • allynm
    replied to calling a DLL from a thread
    in C
    Hi Weaknessforcats-

    Thanks for the very nicely documented and CLEAR reply. I am doing exactly as you indicate in your first snippet. Your third snippet regarding pointers is extremely helpful. I might have tripped up on that at a future time.

    I am still playing around with Mutexes (Mutices?). Richter's 97 book is very good on this subject. I was aware of the process-boundedness of critical sections, but a reminder...
    See more | Go to post

    Leave a comment:


  • allynm
    replied to calling a DLL from a thread
    in C
    Hi Weaknessforcats :

    The DLL that gets loaded contains an Add function---really trivial. Add does what it says: Adds two numbers. Each thread uses Add. When the threads do the addition, I pass the integers directly to the Add () function in the function signature. The values that are passed in the signature are not variables.

    If the variables were global and had the same values, then I suppose I would need to worry...
    See more | Go to post

    Leave a comment:


  • allynm
    replied to calling a DLL from a thread
    in C
    Hi Weaknessforcats ,

    Sorry I've been slow getting back to you with a reply to your last message.

    In the two threads I create, all I do in each one is to load a DLL and call a function in the DLL. Because it was a read only operation, I assumed that I didn't need to enter/leave a critical section. This may be a misunderstandin g I have about what happens in thread synch problems. If so, I would be grateful if you would...
    See more | Go to post

    Leave a comment:


  • allynm
    replied to calling a DLL from a thread
    in C
    Hi Weaknessforcats :

    Thanks for suggesting these possibilities. They were very helpful. I checked them out. I spent most of the day solving the problem, and I guess what I took away from it all was that creating threads is a bit trickier than I realized.

    What it came down to was that I needed to put a WaitForSingleOb ject() call with the INFINITE option set. I put this call right after the call to CreateThread() inthe...
    See more | Go to post

    Leave a comment:


  • allynm
    started a topic calling a DLL from a thread
    in C

    calling a DLL from a thread

    Hello everyone,

    I have a math function dll (MathFuncsDll.d ll) with several different functions. I would like to explicitly (dynamically) load one of the functions in a new thread. I use MSFT CreateThread to create the thread and within this call there is a function, let us call it ThreadFunc, that is called. In ThreadFunc I try to load the library (MathFuncsDll.D ll) and call one of the functions in the library. Unfortunately, nothing...
    See more | Go to post
No activity results to display
Show More
Working...