|
dear friend
i can understnad this, how to create 10 3x4 arrays using this way, i can't finish it, thanks a lot.
so urgent!!!!!!!!
Li Zhiyuan
5/10/2006
|
|
|
|
|
dear friends
any one has write() and read() specification. thanks...
Li Zhiyuan
5/10/2006
|
|
|
|
|
li zhiyuan wrote: any one has write() and read() specification. thanks...
MSDN has: write [^], read [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
That code is exceptionally badly formatted! I can't even be bothered looking at it.
Steve
|
|
|
|
|
This is homework related stuff:
double dHomeworkArray[10][3][4];
//Meta code
for(...10)
for(...3)
for(...4)
dHomeworkArray[10][3][4]=(double)rand()/RAND_MAX;
to save write the complete array to disk
fwrite( &dHomeworkArray, sizeof( double ) * 10 *3 *4);
Greetings from Germany
|
|
|
|
|
thanks, but i tried to debug it, it can't initialize dHomeworkArray....what happened? thanks
the following is code what i have done and debugged.
double dHomeworkArray[10][3][4];
//Meta code
for(int i = 0;i<10; i++)
dHomeworkArray[10][3][4]=(double)rand()/RAND_MAX;
{
for(int j=0;j<3; j++)
{
for(int k=0;k<4;k++)
cout << " " << setprecision(6)<<dHomeworkArray[i][j][0]<<"<<" " <<dHomeworkArray[i][j][1]<<" "<<dHomeworkArray[i][j][2]<<" "<<dHomeworkArray[i][j][3]<<endl<<endl;
}
Li Zhiyuan
5/10/2006
|
|
|
|
|
HI ,
I have coded a C++ project which enhances a C makfiile project
The orignal Solution had only one project
Anyway I am using some of the symbols/sturctures of the C makefile project
So... IN the C makfile project I __declspec(dllexport) those symbols/structures and the C makfile project genarates in .obj directory obj's and .lib('s)
Under Tools->;options VC++ directories I add the .obj directory
where the LIBRARY tab containing the exported symbols
In the the second project I __declspec(dllimport) the symbols/structures
However the First project builds fine
While in the Second I get linker errors unresolved __declspec(dllimport)
Thankx
|
|
|
|
|
Does the linker find the lib? Is it in the build path?
Greetings from Germany
|
|
|
|
|
Hi friends, troubling you yet again...
I want to communicate with serial port (COM1).
I want to send/receive some data through it.
I have read earlier post, & also found a project on serial port.
But i m not able to understand anything of that.
I simply want to brief steps about
->opening a port
->reading a port
->write a port
Thanking you in advance
|
|
|
|
|
tina- wrote: ->opening a port
CreateFile or (CreateFileEx ) function, if you have a look at MSDN configuration sample [^], you can easily figure out the usage.
tina- wrote: ->reading a port
->write a port
ReadFile and WriteFile : the usage in not-overlapped mode is not such difficult, but perhaps you need to go multithreading.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
CPallini wrote: CreateFile or (CreateFileEx)
thanx friend.
the project i downloaded (abt serial comm) used CreateFile, but wat do u think will be the first parameter (lpFileName)?
will it be COM1
|
|
|
|
|
It must be _T("COM1") for serial port 1.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
How can we know if a data has been received at the serial port ?
is it required to check the port continuously, using ReadFile(), & if it return anything than 0, then we conclude that a data is received ?
|
|
|
|
|
Yes, if you use not-overlapped I/O. This way the application probably needs an additional thread always waiting for incoming data on the serial line.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
It depends of the timeouts you specified on the comm port. Basically, you can configure your COM port so that it never waits for data (ReadFile returns immediately) or that it blocks forever until some characters have been received, or something in the middle. Check the SetCommTimeouts[^] function.
Anyway working with the serial port is not something easy for a beginner. So expect some frustration because nothing works as expected. But we're to help if needed .
modified on Monday, January 21, 2008 2:37:11 AM
|
|
|
|
|
Try using CMSCommCtrl class . for this you have to add MSCOMM32.ocx control activex control to your project.
|
|
|
|
|
Check Ramon Klein's very nice implementation, he should have an article here on CP and
his web page for updated source code.
|
|
|
|
|
Hello,
I am using a windows hook for keyboard using the command:
SetWindowsHookEx(WH_KEYBOARD, CallWndProcHook_KEY, g_hinstDll,NULL);
which catches all windows's keyboard messages.
my question is how do I find the target window which the the message (WM_KEYDOWN) is being sent to? I want to get the window's handle inside my callback function CallWndProcHook_KEY.
I know its possible because the spy++ presents the message's window.
Can sombody please help me?
Thanks,
T.R.
|
|
|
|
|
I think you have to go through EnumThreadWindows [^] function.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Thank you,
But I still dont understand: I want to get the specific window which the message WM_KEYDOWN is being sent to.
how do I know which of the EnumThreadWindows retuned windows is the one I want?
Actually, what I am trying to do is to get the caret position from an edit of another application, for example internet explorer, by using the code: HWND hCaret = ::GetForegroundWindow().
Unfortunatly the window which is returned is the iexplorer main window and not it's child window which holds the caret. My idea was to get the inner edit box's handle from the WM_KEYDOWN message that is being sent to it.
Do you have some better idea (I am sure that there must be a much simpler way...)
Thanks very much,
T.R.
|
|
|
|
|
tal1111 wrote: how do I find the target window which the the message (WM_KEYDOWN) is being sent to?
I haven't tested this, but I would guess ::GetFocus() will give you the target window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone,
I am new to asynchronous I/O. Could anyone recommend some tutorials for beginners, especially how to handle asynchornous I/O with network input/output.
The set of APIs I want to learn is like CreateIoCompletionPort, GetQueuedCompletionStatus, etc. I can not find related samples from MSDN, so I am wondering if you have any recommended articles.
thanks in advance,
George
|
|
|
|
|
|
Thanks Hamid,
I looked through this article, it is not covering Window Server 2003, but I am using Windows Server 2003.
regards,
George
|
|
|
|
|