|
Roughly, it should be possible to:
1. Enable Logon auditing in group policy.
2. Subscribe to that particular event using Event Log API's EvtSubscribe[^]
Your program would need to run as a service, because it's possible that noone is logged in at the very moment. I have to little detailed understandiong of the matter toto provide better help, btu that might get you started.
|
|
|
|
|
So here is my problem, I have a c library that I am compiling under CygWin.
I am using Swig to generate a c# wrapper class to it. So I follow the steps to do this. And everything compiles, etc... however..
the defined export names of the functions and constants etc have entry points named in the following fashion:
"swe_sol_eclipse_when_glob"
when I do a 'dumpbin -exports' on the dll the entry points are being named in the fashion of:
"swe_sol_eclipse_when_glob@28"
Is there a way to get rid of the '@xxx' from the names during compilation ?
The makefile is like this:
CFLAGS = -fpic -D MAKE_DLL -g -O9 -Wall # for Linux and other gcc systems<br />
OP=$(CFLAGS) <br />
CC=cc #for Linux<br />
<br />
# compilation rule for general cases<br />
.o :<br />
$(CC) $(OP) -o $@ $? -lm<br />
.c.o:<br />
$(CC) -c $(OP) $< <br />
<br />
SWEOBJ = swedate.o swehouse.o swejpl.o swemmoon.o swemplan.o swepcalc.o sweph.o\<br />
swepdate.o swephlib.o swecl.o swehel.o Sweph_wrap.o<br />
<br />
swetest: swetest.o libswe.a<br />
$(CC) $(OP) -o swetest swetest.o -L. -lswe -lm<br />
<br />
swemini: swemini.o libswe.a<br />
$(CC) $(OP) -o swemini swemini.o -L. -lswe -lm<br />
<br />
# create an archive and a dynamic link libary fro SwissEph<br />
# a user of this library will inlcude swephexp.h and link with -lswe<br />
<br />
libswe.a: $(SWEOBJ)<br />
ar r libswe.a $(SWEOBJ)<br />
<br />
libswe.so: $(SWEOBJ)<br />
$(CC) -shared -o libswe.so $(SWEOBJ)<br />
<br />
clean-swig:<br />
rm -f ../../testsweph
An example of an export is this:
#define EXP32 __declspec( dllexport )
.
.
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
An example of the generated c# wrapper:
<pre lang="cs">[DllImport("libswe.dll", EntryPoint="CSharp_swe_heliacal_ut")]
public static extern IntPtr swe_heliacal_ut(double jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6, HandleRef jarg7, HandleRef jarg8, string jarg9);
Swig Generated C Wrapper compiled in...
<pre>SWIGEXPORT void * SWIGSTDCALL CSharp_swe_heliacal_ut(double jarg1, void * jarg2, void * jarg3, void * jarg4, char * jarg5, void * jarg6, void * jarg7, void * jarg8, char * jarg9) {
void * jresult ;
double arg1 ;
double *arg2 = (double *) 0 ;
double *arg3 = (double *) 0 ;
double *arg4 = (double *) 0 ;
char *arg5 = (char *) 0 ;
int32 arg6 ;
int32 arg7 ;
double *arg8 = (double *) 0 ;
char *arg9 = (char *) 0 ;
int32 *argp6 ;
int32 *argp7 ;
int32 result;
arg1 = (double)jarg1;
arg2 = (double *)jarg2;
arg3 = (double *)jarg3;
arg4 = (double *)jarg4;
arg5 = (char *)jarg5;
argp6 = (int32 *)jarg6;
if (!argp6) {
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null int32", 0);
return 0;
}
arg6 = *argp6;
argp7 = (int32 *)jarg7;
if (!argp7) {
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null int32", 0);
return 0;
}
arg7 = *argp7;
arg8 = (double *)jarg8;
arg9 = (char *)jarg9;
result = swe_heliacal_ut(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
{
int32 * resultptr = (int32 *) malloc(sizeof(int32));
memmove(resultptr, &result, sizeof(int32));
jresult = resultptr;
}
return jresult;
}
|
|
|
|
|
XenobiusII wrote: Is there a way to get rid of the '@xxx' from the names during compilation ?
As far as I recall the @xxx is an offset value used by the linker/loader and is not actually part of the exported name. Try linking with the undecorated name to check that it works correctly.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi everybody i've started learning C++ and i wanna know what are the things that we can do with ? i mean real projects
thks
|
|
|
|
|
You can do more or less anything with C++, there are very few limitations. I would suggest you spend some time browsing the articles[^] here on CodeProject to see some interesting examples.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi
I have created my own CWnd Class named CShell my problem is OnChar function not called
here with i have attached the code sample
#pragma once
// CShell
class CShell : public CWnd
{
DECLARE_DYNAMIC(CShell)
public:
CShell();
virtual ~CShell();
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
private:
CStringArray m_shellText;
int m_cxChar,m_cyChar,m_cxCaps;
TEXTMETRIC m_tm;
public:
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};
// Shell.cpp : implementation file
//
#include "stdafx.h"
#include "CommandLine.h"
#include "Shell.h"
// CShell
IMPLEMENT_DYNAMIC(CShell, CWnd)
CShell::CShell()
{}
CShell::~CShell()
{}
BEGIN_MESSAGE_MAP(CShell, CWnd)
ON_WM_CHAR()
END_MESSAGE_MAP()
void CShell::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
//CWnd::OnChar(nChar, nRepCnt, nFlags);
}
|
|
|
|
|
|
Please make your links clickable. Do you have the checkbox Treat my content as plain text, not as HTML selected?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I see I did have the 'treat as text' checked, though it worked as link in the 'preview message' so I thought I'd got it right.
Thanks.
|
|
|
|
|
Dear All,
I am using VS2008 express edition. I would like to add .txt file as resource file into the VS project and furthur read this file as a normal file read.
I was able to add the file as resource file. But don't know how to read this file
i just used :
ifstream fileread;
fileread.open("test.txt");
but this doesn't seem to work
Do u have any suggestions how this can be accomplised.
BR,
Raghu
|
|
|
|
|
This is not the correct forum. But anyway...
First get a pointer to the resource.
You can get this by calling the following APIs in order -
FindResource
LoadResource
LockResource
Next use the pointer returned by LockResource in a call to CopyMemory or memcpy /memcpy_s .
|
|
|
|
|
I want to return a reference to a subvector of an std::vector like boost::ublas's subrange method does. For example:
...
std::vector<int> v1(100, 1), v2(10, 2);
subrange( v1, 0 /*start/, 10 /*end*/) = v2;
...
will change the first 10 element of v1 to be those of v2. Another call like
v2 = subrange( v1, 50 /*start/, 60 /*end*/);
will fill up v2 with values from v1's 50th to 59th elements.
How to implement method subrange? Thanks a lot.
|
|
|
|
|
|
The link you provided just lead to the same page of this ATL_WTL-STL discussion page. Anything missing? Thanks.
|
|
|
|
|
|
hi,
i have application that disply USB cemera video .for that i have to connect with samplegraber and get image anyone please hehp me
|
|
|
|
|
Please explain your problem in proper detail and tell us which part is not working.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hello,
I apologize if this is the incorrect site to post, but I could not find any topics that related the above discussion.
Could you please let me know, if any differences at all between the above commands.
We have a program, that needs to be running constantly with a pause of 3 minutes before the next run.
We have 13 such programs.
So, we are considering performance a big part.
Thanks again.
|
|
|
|
|
If you enter CHOICE /? and TIMEOUT /? from a DOS prompt it will show you all the possible options.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I wondered if anyone can enlighten me on this. I can't seem to find anything from Microsoft that definitely states that AES 256 bit encryption can be enabled under Windows XPe. Does anyone know if this is possible, or am I stuck with triple des? If anyone can shed any light, point me to some articles, etc. Specifically, I need to do some column level AES 256 encryption using SQL Server 2005. DES works fine, but I get an error that AES is not supported.
|
|
|
|
|
Not so sure, but I'll try.
Microsoft's documentation seems to be a little murky on the subject, I agree. However, reading between the lines - one can see from the following two links, that you don't appear to have any support for doing this directly in SQLServer, though .NET 1.1 apparently has an AES_256 class, which DOES work in XP.
How to: Encrypt a Column of Data[^]
AES256 Class[^]
However, there does seem to be an article on AES here at CP. I'm afraid I have to admit I've no idea on the suitability of such an idea for your situation.
WinAES: A C++ AES Class[^]
Cheers.
|
|
|
|
|
I have a COM dll Win32 developed with C++.
I want to create 2 different versions :
- One in 32 Bits
- One in 64 Bits
This 2 dll must be usable on the same PC by different applications.
How can I do this ?
Also,I know how to build dll in X64, But have they the same guid or not?
|
|
|
|
|
Both DLLs can have the same GUID.
When registering 32-bit and 64-bit DLLs, the registry entries created for each of them are in different registry locations.
So it is possible for both of them to be used of the same PC using the same GUID.
When a 32-bit application creates an instance of the COM, the registry access will be redirected to the appropriate location and it will find the 32-bit COM DLL.
And a 64-bit application will create the 64-bit COM DLL.
|
|
|
|
|
|
The terms in capitals are used in MFC and are not specific to the C++ language. The remaining terms are functions used in the C++ libraries. The return value of a function is defined by the function definition. All this information can be found by searching MSDN; a starting point for C++ is here[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|