|
I need to write a sotware to be placed on one machine and can run some of its functions on an other computer knowing the ip address
for example ( shut down an other computer using its IP address)
I need Details because I'm new to this field
thanks in advaced
MR.Byte
|
|
|
|
|
DCOM i think is what you'd be interested in reading about.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I have created an ActiveX control. Now i want to register this control in another machine. I copied the .ocx file to that machine and used the regsvr32 for registering the control. But i'm getting an error "LoadLibrary("control.ocx") failed. Invalid Access to memory Location."
Why is this. I have the local admin power to register the control in that machine.
Pls help
Vini
|
|
|
|
|
Could it be your .ocx is dependant on some DLLs not present in the target system? Check for dependencies from the C run-time library and MFC.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for the reply. But i'm new to this area. So can you tell me how to check for the dependencies?
Please...
|
|
|
|
|
Sure. Go to Project->Settings->General tab. The "Microsoft Foundation Classes" combobox sets whether MFC is statically or dynamically linked ("Shared DLL"). If the latter, try switching to the former to see if your problem disappears.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It worked!!!!!
Thanks a lot....
Vini
|
|
|
|
|
Dear friends
I am new to VC++ and I need to display a bitmap file which i stored as an resource file or u can consider it as an input file. I want to do it using Win32 API.
Will you please give me provide me any such file's complete .dsw file. It will be very helpful to me. I don't have much time, charles petzold book have so many such files but at present i don't have that book and i have to submit this project in 1-2 days. Please help me and do the needful.
Thanking you in advance.
Binay
|
|
|
|
|
HBITMAP hBitmap;
CClientDC dc(NULL);
CString szBmpFile(_T("..."));
hBitmap = (HBITMAP)LoadImage(AfxGetInstanceHandle(),szBmpFile,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
BITMAP bm;
CDC dcMem;
::GetObject(hBitmap,sizeof(bm),&bm);
dcMem.CreateCompatibleDC(pDC);
HBITMAP pOldBitmap = (HBITMAP)(dcMem.SelectObject(hBitmap));
CRect rect
pDC->BitBlt(Rect.left,Rect.top,bm.bmWidth,bm.bmHeight,&dcMem,0,0,SRCCOPY);
|
|
|
|
|
Dear Wangyiming
Thanks a lot for ur response.But I want to get a complete source code or complete .dsw file. I always refer Charles Petzold for basic programming code. here I don't have that book. So please give me such file which is a reads one .bmp file and displays it by getting hdc. It will be a great help to me at this time. I don't have time and have so much tension. Kindly help me.
Thanking you in advance.
Binay
|
|
|
|
|
DEar Wangyiming
Thanks for ur code. I want to a complete .dsw file. I always refer Charles Petzold book fo basic programming code. So please give or send me any such file which reads a bitmap file and then display it after getting hdc.
Thanking you in advance.
Binay
|
|
|
|
|
Dear friends
I am new to VC++ and I need to display a bitmap file which i stored as an resource file or u can consider it as an input file. I want to do it using Win32 API.
Will you please give me provide me any such file's complete .dsw file. It will be very helpful to me. I don't have much time, charles petzold book have so many such files but at present i don't have that book and i have to submit this project in 1-2 days. Please help me and do the needful.
Thanking you in advance.
Binay
|
|
|
|
|
Hi,
#define GetRandom(min, max) ((rand() % (int)(((max) + 1) - (min))) + (min))
I found this algorithm from this discussion forum. However, i found that every time it produces the same "sequence" of output. For example, GetRandom(2, 100), the sequence is 43, 55, 99, 69, 64, 84, 95, 56...............
Since i'm doing multithread, my threads get the same result when they call it.......... so...............can anyone help me???
Thanks!
|
|
|
|
|
rand is a psuedo-random number generator. That means that the same sequence of numbers will be generated each time you use it in an application, however, the sequence of numbers that it generates are uniformly distrubuted. Which means that they are essentially random.
You can make the sequence become random each time you run your app if you seed the number generator with the srand() function when your app or thread starts up. The current time may be a good value to use to seed the number.
|
|
|
|
|
Anonymous wrote:
i found that every time it produces the same "sequence" of output.
If you use Srand() before your random function,then this won't happend.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Sorry, I don't quite understand how to use srand()????
i found this in MSDN: ( and i implement in my program)
srand( (unsigned)time( NULL ) );
GetRandom(2,100)
but everytime i run it.............it is increasing order.......until 100.......
e.g.
31, 33, 33, 35, 38, 42, 47.......89, 99, 3, 5, 10, 15, 22....
What is the problem then?
|
|
|
|
|
Use srand( (unsigned)time( NULL ) ) only once at the beginning of the program to "randomize" the sequence generated by GetRandom . Do not use it every time you call GetRandom .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks....it works now!!!
|
|
|
|
|
I am working on a custom drawn menu. I am able to get the rect of the menu items, but the rects coordinates are not in relation to the screen. How can I get the menu items cords for the screen?
|
|
|
|
|
Try using ClientToScreen
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Thats what I thought too, but CMenu is derived from CObject not CWnd. So how do I get the window handle for the menu. Is that even possible?
|
|
|
|
|
Maybe GetMenuItemRect will help? It returns a rectangle using screen coordinates.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Perfect... One more question. Is there an equivilant function to get the rect of the whole menu not just each item?
|
|
|
|
|
How to change an int variable to cstring, so that i can post it using AfxMessageBox....
|
|
|
|
|
CString str;
str.Format("%d",5);
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|