|
I do not know much about RPCs except that they are technical and complex, but they might be just the thing for you. I am 95% sure that DCOM uses RPC for it's inter-system communication. Perhaps there is a good DCOM solution; at least then you will be using current Windows technology. I think that there are some articles that say that since DCOM uses RPC, and since RPC is standard technology, DCOM can sometimes communicate with non-Windows systems that do not have DCOM. If you use RPC directly, then you will probably have a very portable solution, in case that matters.
|
|
|
|
|
Hi,
I am using an electronic device that uses parallel port to communicate with the computer. The problem is that: This device is used to record some sound (It has an ADC converter on it.) By using an assembly program in DOS, i was able to record the sound at 8 KHz. However, i cannot record the sound under Windows.
How can i notify my program every 1/8 ms?
Or how can i pause my program at a specified line for 1/8 ms long?
Thank you for any helps in advance!
Mustafa Demirhan
|
|
|
|
|
I have two program - one design by delphi ,I have source,the other design by VC,I can't change it,The
second program send a message to the first,the message include a data struct like:
struct
{
int a;
int b;
LPSTR *pFilePtr; //what's this?
}
how can I get the message and controrl it?
please give me a sample by delphi or C
Thanks
|
|
|
|
|
You can't pass a pointer to your structure in a message wParam or lParam, because the two programs have different address spaces.
As far as I know you have to use the WM_COPYDATA message, refer to MSDN for details, I never used it.
Otherwise you may try some other way to communicate with another process, such as mailslots, named pipes, memory mapped files ...
Hope this helps,
Paolo.
|
|
|
|
|
Can I made a DLL and share a shared struct then I call the DLL,and He send data to DLL ?
|
|
|
|
|
When you load a DLL into different processes its code runs in the calling process address space, so you can't.
However there's a way to use a DLL to share some memory between processes, but I don't know it in details (you define a shared memory section in the DLL).
I think a WM_COPYDATA msg is the simplest thing to just pass a structure. If you need info go to:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winbase/ipc_2mw1.htm
Paolo.
|
|
|
|
|
I'm using Win98, Visual Studio/C++ 6.0, writing a simple Win32 Console App, such as Hello World. The dos console window produced is 80x25, and captures only the last 25 lines written to it.
How can I capture more lines and print them out?
Rick Marshall
SAIC @ China Lake
|
|
|
|
|
This can change the number of lines in the console - you'll need to #include <windows.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
if(hConsole != INVALID_HANDLE_VALUE)
{
COORD size;
size.X = 100;
size.Y = 500;
SetConsoleScreenBufferSize(hConsole, size);
}
And I think you can read the output with ReadConsoleOutput. There are other fns for sizing the window size - SetConsoleWindowInfo - etc. Check the console reference in the MSDN.
|
|
|
|
|
Thank you, Tim, the code worked just fine.
Rick Marshall
SAIC @ China Lake
|
|
|
|
|
Does anbody know how to specify the parameters for the copy function of an Excel worksheet?
//get the second sheet in the workbook
_Worksheet sheet = sheets.GetItem(COleVariant((short)2));
//Now copy the worksheet into the same workbook
sheet.Copy(const VARIANT& Before, const VARIANT& After);
How do you go about specifying the params for the Copy function? I tried "Sheet2", "Template", using index of 2...
|
|
|
|
|
Howdy!
I was hoping that someone could tell me how to make my application get it's "fake" system colors (wich I define) on another place in the registry. I want to be able to redirect where my application(and mine only) gets its colors on another location in the registry. How would this be done in visual c++? And what would the code be like?
Thankfull for any answers,
/Fredrik
|
|
|
|
|
I don't understand what you're asking for. What do you mean by "gets it's colors"? What do you mean by "on another location in the registry"?
|
|
|
|
|
The dialog window looks for what colors windows have in the registry and uses these colors to color the dialog. Thats the system colors that are located in the registry under the key: "MyComputer\HKEY_CURRENT_USER\Control Panel\Colors". These are the so called system colors, the colors the system sets for your dialog (if you don't draw it yourself). What I want to do is, I'd like my dialog window to look for it's own colors in the same kind of way, but at another location, wich I would have define. Maybe, "MyComputer\HKEY_CURRENT_USER\Software\MyProgram\Colors" where I can set the dialog window colors myself. To do this, I have to change where in the registry my dialog window looks for it's colors. Adding the necissary keys and colors is no biggie, but how do I redirect where\how the program looks for these colors?
|
|
|
|
|
Sorry, but you simply can't do this.
In order to get different colors, you have to intercept the WM_CTLCOLOR messages for each control (or control type) and for the dialog itself.
|
|
|
|
|
Ah, would have been real neat though =)
Ok, could you help me with intercepting the WM_CTLCOLOR messages. I've tried this but I only managed to do it with te buttons, and used SetDialogBgColor() to chandge the dialogs "view" color, but a few things remain. The color of my slider, ComboBox, the menu, the boarder (or is it called frame) of the dialog window.
Thx, most thankfull for help. =)
/Fredrik
|
|
|
|
|
Hallo
Can somebody help me.
How can i record in realtime from a video camera to my hard drive??(AVI File) i need the code for AV and DV(firewire)
or somebody can tell me how they talk togheter.
B.R
BA
|
|
|
|
|
its very simple try using avicap class.it automatically save the video in file name capture.avi.there is a hell of detail in msdn or contact me i am also doing same things now a dayz
bye
bobbies_2001@yahoo.com
bobby
|
|
|
|
|
How to change the PropertySheet tab caption's color
|
|
|
|
|
So I've used the old _CrtDumpMemoryLeaks() and found my program has leaks. Now I want to use _crtSetBreakAlloc() to stop before these errors. However, during runtime none of the following expressions succesfully evaluate:
-> _crtBreakAlloc
-> {,,msvcr40d.dll}*__p__crtBreakAlloc()
-> {,,msvcrtd.dll}*__p__crtBreakAlloc()
and I've also tried setting my code configuration to Debug Multithreaded DLL, and Debug Single Threaded, Multithreaded DLL, all which produce the same result? I've also tried setting compile time _crtSetBreakAlloc(). Oh, and it is definetly the building in debug configuration.
Thanks in advance for any help...
Brendan Tregear
Scan Optics
32 Stirling Street
THEBARTON
SA 5031
|
|
|
|
|
I can't help much except to suggest that you state explicitly whether you are using MFC. Are you using VC 6?
|
|
|
|
|
Something I do on occasion (as per MSDN docs) is start the prog with F10, then during the initial break, bring up the watch window and type in _crtBreakAlloc. If its 'there' it should show as -1. I then manually enter the number of the allocation I'm trying to track down.
I should note that my exp with this has been with MFC, and CObject dumps. But this little test might serve to show you if the var is available.
|
|
|
|
|
Thanks for your help everyone but it still doesn't work. I've followed the directions exactly according to Knowledge Base Question ID: Q151585 "HOWTO: Use _crtBreakAlloc to Debug a Memory Allocation" without luck.
Looks like I'll have to get an off-the-shelf memory-leak detection package.
Thanks anyway
Brendan Tregear
|
|
|
|
|
Spending a day at home (nursing a cold - sympathy welcome) so thought I'd play with this a little bit - using a single threaded console application - and may have 'half a solution'.
The problem seems to be one of declaration and linkage - the prototype for _crtBreakAlloc begins with _CRTIMP, which resolves to nothing if not building a multithreaded dll. (Maybe the key is to place this stuff in a DLL and link with it)
Anyway, I managed to redefine and assign _crtBreakAlloc thusly:
extern long _cdecl _crtBreakAlloc = 21;
which the linker complained about. Telling the linker to use the FORCE switch got past that, and the allocation did cause a debug break.
Not a very robust solution though. Maybe someone else can expand on this. Would be nice to know a straightforward way of linking with these methods.
|
|
|
|
|
Thanks Tim, it works. You've got my sympathy *and* gratitude
Regards
Brendan Tregear
Scan Optics
32 Stirling St
THEBARTON
SA 5031
|
|
|
|
|
Hi Everyone,
I have a question regarding generating random number. Is there a function that can generate random number between a range without having the random number repeat itself?
For example, let's say I have 100 records in a database. i want to randomly select a certain number of records upon user input and make it as a new table.
if i use rand() function, and mod the numbers by 100, i'll get the numbers between 1 and 100, which then i can use to set the position of the record to copy that row of data. but the numbers might repeat themself if i select a large amount of records out of the 100.
is there a way to check the random number generated to see if it has already been selected before?
If anyone knows, plmk. thanks
steve
|
|
|
|