|
|
toxcct wrote: cynferdd wrote:
"Anonymous" guy with no name
isn't it the same ?!
I meant "with no name written"
lol
|
|
|
|
|
what he wants do to is probably the same as i; getting members a la IntelliSense...
|
|
|
|
|
maybe you could ask the Visual Assist team...
i doubt you have some answers, but why not to try ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Calling EgWin::Calibrate works only if i do some stuff like Write nothing before i call another void in an unmanaged dll. Why does it not work if i take out this stupid Console::Write("") ??
<code>
class EgWin
{
public:
EgWin() {}
~EgWin() {}
int Init() { return EgInit(&stEgControl);}
void Calibrate(IntPtr hwnd){Console::Write(""); EgCalibrate(hwnd);}
};
public __gc class EgWinProxy
{
public:
EgWinProxy(){}
~EgWinProxy(){}
int _EgInit(){return mpC->Init();}
void _EgCalibrate(IntPtr hwnd){mpC->Calibrate(hwnd);}
private:
EgWin * mpC;
};
</code>
|
|
|
|
|
How is EgWin able to see methods on EgWinProxy at all ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The call gets from EgWinProxy to EgWin and from EgWin to an unmanaged dll wich is not visible in this sniplet. EgWin can not see EgWinProxy, but EgWinProxy keeps a pointer to EgWin.
Hope you have an idea...
|
|
|
|
|
Hi fellows
I've discovered the direct.h recently and I would like to know where I can find more infomation about this header file. Someone can pass this infos for me? Tutorials and links are very good ideas.
Thanks for help
|
|
|
|
|
I think you've found a DirectX header. The header is worthless without hte rest of the library. Google for DirectX.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
I found really unexpected behaviour of calls from C++ managed extensions, to native code. Following code shows what I wanted to do:
#pragma unmanaged
class UnmanagedClass
{
public:
virtual bool unmanagedFunction() const
{
return false;
}
};
#pragma managed
void managedFunction()
{
UnmanagedClass* object = new UnmanagedClass();
bool result = object->unmanagedFunction();
}
The question is- what would be the value of "result" after
virtual function call? Well.. believe me or not, but it's TRUE!
I debuged it in disassembly window, and inside native code-
the value of EAX (AL actually) register is correctly set to FALSE (xor al, al)
When the function does return, my debuger shows that EAX value has changed- into TRUE! There must be some kind of managed wrapper between Managed Extensions code and native code.
Has anybody any idea what is going on here?
And how to solve the problem?
|
|
|
|
|
I got the same result you got. Don't know why.
Anyway, normally I use the #pragma managed and unmanaged to control the function compilation only and for the class, I use either __nogc or __gc to tell it if I want the class managed or unmanaged.
I tried the modified code below and it works. hope this help.
__nogc class UnmanagedClass
{
public:
virtual bool unmanagedFunction() const
{
return false;
}
};
#pragma managed
void managedFunction()
{
UnmanagedClass* object = new UnmanagedClass();
bool result = object->unmanagedFunction();
}
|
|
|
|
|
I believe its been mentioned somewhere that there is a bug in the compiler, or perhaps the runtime, that gets confused with bool in regards to calling unmanaged code from managed code. I believe one work around is to use BOOL instead of bool. I think what happens is that the size is wrong between the two worlds, 8bit in unmanaged, but 32bit in managed, and the translation doen't account for it. I could be wrong, of course.
--
Joel Lucsy
|
|
|
|
|
Initially i allocated a buffer:
void *mem = new char[512];
now i want to use 100 bytes start from mem + 10,
so i wrote like this:
void *addr = static_cast<void*>
( static_cast <size_t> mem + 10 );
error occured! so please help me
my IDE is VS.NET 2003!
-- modified at 2:08 Tuesday 25th October, 2005
|
|
|
|
|
void* size is null, better cast it on char* :
void* addr = (void*) ((char*) &mem[10]);
If it doesn't compile, try to move the (char*) casting in another location, such :
void* addr = (void*) &((char*) mem[10]);
Kochise
In Code we trust !
|
|
|
|
|
firstly, provide the error message caugth instead of saying that an error occurs. it will help use more efficiently to understand what's happenning.
secondly, be careful when posting template codes (here, with static_cast<> ) because the < > are interpreted as html tag delimiters. use the & l t ; and the & g t ; codes, without spaces or check the Ignore HTML tags in this message (good for code snippets) check box at the bottom of where you type your post.
to finish, i'd suggest you this (as i don't know in what type you static_cast your pointer, i may be wrong) :
you cannot apply the + pointer addition operator on a void* operand because the operator + have to know of how many byte it will move to and void have by definition no size. what happens now if you firslty cast mem into char*, add 10 to it (to move it 10 bytes forward) and type cast it back to void* (like following) ??
void* mem = new char[512];
void* addr = static_cast<void*>(static_cast<char*>(mem)+10);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Is there a hash string function that preserves the capability to compare two strings just by comparing their respective hash values ?
Currently, I have to perform a full Str.Compare("other string") in order to sort them. I had also calculated their hash value, but the sorting (Quick Sort, Bubble Sort, whatever...) fails using the hash value. The hash value is mostly random, especially on long strings.
Comparing the hash values (int) would have been quite faster, I have to perform the quickest sort possible on text files larger than 100 MB ! So please don't come with CString as a solution. It works, but asks hours to do the job. CString is perfect to manipulate UI strings, but bad for heavy duty purposes...
So, to sum up, it there a good hash function that will allow :
"Minus string" < "Plus string"
HASH("Minus string") < HASH("Plus string")
Kochise
In Code we trust !
|
|
|
|
|
it is the scrollbar that we are able to modify SMALLCHANGE and LARGECHANGE values. Setting them to 1 we are able to scroll thru all VALUES between MIN and MAX. !!But if we modify LARGECHANGE to say 10 we will not be able to scroll thru all VALUES? and the scrollbar it self increases in its size? whats the problem
9ine
|
|
|
|
|
Hi,
I am working in Windows 2003 platform. I have a Windows service that runs in the local SYSTEM account. The service is compatible in Windows NT/Me/2k/XP/2k3.
My problem is that I need to restrict users from terminating this service using Windows Task Manager.
For this I tried to step up the previledge of the service using the AdjustTokenPrivileges API, this way I am able to restrict users from terminating the service only on NT/Me/2k/XP. Whereas in 2003 this Privileges boosting does not help and the user is able to terminate the service.
Help me with any other API that you know or a completely different approach is also acceptable.
Advance thanks to ur suggestions.
|
|
|
|
|
e_prabhu wrote: My problem is that I need to restrict users from terminating this service using Windows Task Manager.
Bad idea. If you absolutely must, you could make the service restart upon close. But preventing the user from terminating the service is a huge red flag. For any code that isn't part of the OS, this is really unnecessary.
Maybe if you tell us what you are trying to do, we could help you find an alternative solution.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi Judah Himango,
I am developing a windows service that monitors all the processes that are created in the system.
whenever user creates a new process, the service gets the notification from my virtual device driver. I extract the information of the process being created and if the process is a notepad (for example), I kill it from the service. So that I restrict any user from accessing a specific program.
Hence I dont want the user to terminate my service from the task manager (especially in windows 2003)and proceed with the application that I am restricting. help me with ur suggestion.
|
|
|
|
|
I think you can use the group policy to limit runable programs
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
I've recently been introduced to the networking side. The first task that I must do is to write a C++ program to capture IP traffic e.g. UDP, TCP, etc.
The second task is to feed this data into an database e.g. SQL or Oracle.
The third task is then to provide reports on this information.
I will be glad if somebody could assist me in this regard.
regards
Deon
|
|
|
|
|
Hello?
I need the Gaussian random number generator.
If you have source code, share to me pls
Thank you so much
|
|
|
|
|
Hi,
Check out "Numerical Recipes in C", Chapter 7.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
I have this program I have to write for school that accepts two integers. hours and minutes. I then have to output the format in 6:00 format. I'm only allowed integer division and and modulus division. I've tried everything I can think of but my output still looks like this. 6:0 Any tips?
BINARY
-- modified at 23:40 Saturday 22nd October, 2005
|
|
|
|