|
Hi,
I too dont have any correct idea, but you can try doing one thing.
try clearing the output stream, perhaps using something equivalent to
fflush(stdin) or a flushall before cout ing anything.
Hope that helps.
Bye.
AslFunky
|
|
|
|
|
solved it. (more or less)
|
|
|
|
|
Please share so that others may benefit.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Actually I don´t know exactly what was the cause...
1. I tried to send the characters using a string or character array. Forgot that en extra "\0" is added. This might have caused some problems.
2.The number of bytes to write parameter in the writefile function: I passed it as an int, then as a short. Had problems with int not with short.
Still I don´t understand why or if this really caused the problems, and why it was only with the "\r"..
doneirik
|
|
|
|
|
Hello all,
I am writing a DLL that wraps another DLL in an interface that can be called from VB.
the dll ahs a callback function defined as
typedef int(_cdecl *cbfuncText)(int HisNodeID, char *str, void *arg);
In my wrapper DLL i have a function that translates this into a new Callbac function
that is defined as
typedef int(__stdcall *cbWfuncText)(int HisNodeID, char* str, void *arg);
When i use the C string directly as shown here VB gets an empty string.
when i try to use a BSTR instead, the VB program crashes.
The VB function i use in the 2 situations are
Function TextCB(ByVal HisNodeID As Long, ByVal str As String, ByRef arg As Long) As Long
and
Function TextCB(ByVal HisNodeID As Long, ByRef str As String, ByRef arg As Long) As Long
Can anybody tell me what i am doing wrong?
and/or give me suggestions of how to solve this?
In Advance thanks
Michael
|
|
|
|
|
When am building my application using DirectX(DirectShow) components,
am getting the following Linker errors:
Linking...
error LNK2001: unresolved external symbol _IID_IMediaEvent
error LNK2001: unresolved external symbol _IID_IMediaControl
error LNK2001: unresolved external symbol _CLSID_FilterGraph
error LNK2001: unresolved external symbol _IID_IGraphBuilder
Debug/trial_DShow.exe : fatal error LNK1120: 4 unresolved externals
Can anyone help in what scenario does the above errors pitch in.??
Thanks, Pramod.
|
|
|
|
|
Hi,
You have to link the needed libs. Think that you have to add strmiids.lib explicity in the linker options
Hope that this will help you
Sujan
|
|
|
|
|
Usually, the link error 2001 means that you didn't link libraries required. The help file of the directshow has a page "Setting Up the Build Environment". Read this page and you'll find these libraries required:
Strmiids.lib
Quartz.lib ( not required if you don't call AMGetErrorText(), can be omitted in your case. )
If you don't know how to link these libraries, a simple way is provided in the following:
1. Click the Menu:
(In Visual C++ 6.0)
Tools -> Options -> Directories, and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
(In Visual Studio .Net)
Tools -> Options -> Projects -> VC++ Directories , and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
2. Add the following codes to where you want to include some files(Ex: You can add them in stdafx.h):
#include "Dshow.h"<br />
#pragma comment ( lib, "Strmiids" )<br />
#pragma comment ( lib, "Quartz" )
good luck!
|
|
|
|
|
Hello developers.
I want ask you if anybody konws how can I create a application which will transfer bits (bytes)
throught a USB port - i mean input/output something like it was in old DOS enviroments using inportp/outportb.
This is why I need to communicate with an own unknown device attached to USB and know that a driver must be created but I don't realy want to use the DDK. Is there a other way to create this
driver?
Apropo: can I get a link to a full example or source code to a USB driver tutorial it will be very helpful
|
|
|
|
|
|
|
Hi ,
I want to Mix audio file and Video File into one file may be AVI ,
using DirectX , ( is it with Direct Show but how ? )
How can i do that ,
Any hint , or idea . Link
thanx
Regards
|
|
|
|
|
|
What I need to do is write a DLL that will play an audio signal. The problem is, the source of the audio will not be any kind of music/audio file or even some recording stored in a wav class of some sort. What I am working with is the raw data, an array representing the entire signal.
For those of you familiar with MATLAB, you know MATLAB has a function called "wavplay".
Let's say I have a 1x200000 array called "audioSignal". If I know that this signal was originally sampled at 50kHz (that is, the samples are spaced apart by increments of 20 microseconds) then all I have to do to play the signal stored in the array is enter the following command:
>> wavplay(audioSignal, 50000);
Of course, if I use, say 30000 instead of 50000 this just deepens the pitch and lengthens the duration of the signal, but doesn't actually change it.
This is exactly the kind of method I want to be able to use in my C++ DLL, but I have no idea how to write a method that does this myself. Does anyone know of any built-in methods that I don't know about, or does anyone know where I can find code that will do this? Any help is good help, God bless.
|
|
|
|
|
Hi
I am working in vc++. I have a library(dll) and a Test application(.exe) which uses this .lib file. I have a function(Thread function) in the dll which has to insert data into a circular linked list . This linked list should be accessible in the test application, and the test application should simultaneously be able to take the inserted data in the dll from the linked list and display in list ctrl.
The linked list should be used as a global interface between the test application and the library. As such, both modules should have a pointer to this linked list.
How can I do this? Can anyone please guide me? I never worked with this kind of application.
Thanks in anticipation of information.
Madhavi.
|
|
|
|
|
Hi,
You can use "Memory Map Files" - Share Memory
Look out for API "CreateFileMapping","MapViewOfFile","OpenFileMapping" etc.
It might will help you !
Regards,
Vishal
|
|
|
|
|
In your dll, just add a function that will return a pointer to the linked list.
One thing really important is that every memory that has been allocated by the dll (with new), must also be destroyed inside the dll, and all the memory that has been allocated by the exe must be destroyed by the exe.
Hope this helps
|
|
|
|
|
Hi guys ,
the other day i was developing a game(the snake game, as in Nokia cellphones) in a dialog based application.
I encountered a serious problem , when i wasn't able to track the keyoard events for the arrow keys(VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN). I have used all possible means, like
OnKeyDown()
and OnChar()
but there is no result .
Can anyone tell me where i am going wrong.
Thanx in advance.;)
AslFunky
|
|
|
|
|
Hint: Handle PreTranslateMessage(MSG* pMsg) filter the message WM_KEYDOWN
ARSALAN MALIK
|
|
|
|
|
Thankx for replying.
I think i am understanding what you are talking about.
I have checked the MSDN and it has three versions of PreTranslateMessage(), namely:
CWinApp, CWinThread and CWnd.
It certainly cannot be CWinThread. Which of the remaining two should I handle? I hope it is the CWinApp!
Can i do it as:
BOOL bHandleNow = FALSE;
switch (lpmsg->message)
{
case WM_KEYDOWN:
switch (lpmsg->wParam)
{
case VK_UP:
case VK_DOWN:
case VK_LEFT:
case VK_RIGHT:
bHandleNow = TRUE;
break;
}
if (bHandleNow)
OnKeyDown(lpmsg->wParam, LOWORD(lpmsg
->lParam), HIWORD(lpmsg->lParam));
break;
}
return bHandleNow;
Please, it would be a lot of help.
Thanx in advance;)!
AslFunky
|
|
|
|
|
For dialog based MFC application, add PreTranslateMessage as virtual function from class menu.
ARSALAN MALIK
|
|
|
|
|
Oh, you got it all wrong.
What i meant was, which class's PreTranslateMessage() should i override, since PreTranslateMessage() is a virtual function in three classes.
Anyway, i have got the answer, we must override the CWnd class's function.
Thanx a lot for helping me out.
That was a real relief
/--------\
|AslFunky|
\--------/
|
|
|
|
|
maybe u dont get the keyz coz u have some other (control or) window on ut dialog box......
that can be the reason,have u tried SetFocus()???
hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|
|
Hi,
thanx for replying.
Yes, i have tried using SetFocus(), but that doesn't work.
Anyway, Arsalan Malik has given the right solution. We must override the virtual function PreTranslateMessage() of the CWnd class.
In this code we have to return a TRUE for the keydown messages if they are VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT. These are stored in the HIWORD and LOWORD of the message of the lpMsg paramater.
Please refer to MSDN if you cannot get this. It is quite clear there.
Thanx anyway.
Bye
/--------\
|AslFunky|
\--------/
|
|
|
|
|
hi,everyone.
i create a static library (mystalib.lib)which contains dialog resources,
and i use this library in an application, but i don't know how to use the dialogs in the library properly:
i specify the mystalib.res file in the project setting->link-> object/modules, and the complier reports a warning:
the mystalib.res already specifed,additional resource file ignored
but the result is that mystalib.res has been linked to the final executable ,and the resource of my application is igored,so my application can't start.
what's the reason for that , and how to link the mystalib.lib with my application properly?
Thanks.
|
|
|
|