|
an some help. am try to import a video file in the form of mpeg-2 file in c++ also request the sysytem turn off for 5ms in c++ but it does seam to work
|
|
|
|
|
Be careful with the time slicing. You might accidentally disturb the space/time continuum.
|
|
|
|
|
do u have any idea how to go about it
|
|
|
|
|
kamarlonaire wrote: do u have any idea how to go about it
A good idea is to explain your problem with adequate information, so that people over here can help you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
what i wsa trying to do is import a file say (video), code in c++, then transmit to other souce say console ,ie input and output
|
|
|
|
|
Hi,
Can anyone please tell me how to launch “Windows Picture and Fax Viewer” programmatically?
Actually when I try to open a picture in “Windows Picture and Fax Viewer” I found that it is loaded in .\Windows\System32\rundll32.exe, but when I executed that rundll32.exe (by double clicking) nothing happens.
Regards,
Mushq
|
|
|
|
|
Unfortunately, windows picture and fax viewer is not an independent stand alone executable which you could just execute "like that". The code which does the stuff is within shimgvw.dll . You don't need to know, but I suggest that you Google for it and try to know what rundll32.exe actually is.
Now, try ShellExecute() with "open ", and pass this as the path
rundll32.exe C:\WINDOWS\System32\shimgvw.dll, ImageView_Fullscreen C:\\myimage.jpg
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks for the positive and quick reply.
Regards,
Mushq
|
|
|
|
|
Man! thanks for tip, i have included that in my faq site, thanks for sharing
|
|
|
|
|
You're welcome, Alok. Feels good to be appreciated by an MS MVP like you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Feels good to be appreciated by an MS MVP like you.
might be consider myself as human before anything.. thanks!
|
|
|
|
|
I tried all day long to send a 'CTRL' input to TeamSpeak to activate voice.
I used PostThreadMessage and PostMessage to TeamSpeak Thread without success.
Is it possible to do ?
|
|
|
|
|
TeamSpeak probably uses DirectSound and therefore probably also uses DirectInput. And DirectInput reads the scan codes directly from the kernel input stream. Try using the SendInput() or keybd_event() functions to simulate your keystrokes. These functions are capable of inserting data into the kernel input stream.
http://msdn2.microsoft.com/en-us/library/ms646310(VS.85).aspx[^]
http://msdn2.microsoft.com/en-us/library/ms646304(VS.85).aspx[^]
The following function will work as well:
void _declspec(naked) __stdcall SendInput(UINT nInputs, LPINPUT pInputs, int cbSize)
{
__asm
{
mov eax, 000011f6h
mov edx, 7ffe0300h
call dword ptr [edx]
retn 000ch
}
}
Best Wishes,
-David Delaune
|
|
|
|
|
you are hard-coding an entry point?
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
Unfortunately you are correct,
In ntdll at location 7ffe0300h resides the SYSENTER instructions as seen below:
7FFE0300 8BD4 MOV EDX,ESP
7FFE0302 0F34 SYSENTER
7FFE0304 C3 RETN
I apologize for the hacked-up code, I wrote the function as I was sipping my first cup of coffee and inserted one of my bad habits of JMPing to known offsets.
It would be a better solution to write the function as:
void _declspec(naked) __stdcall SendInput(UINT nInputs, LPINPUT pInputs, int cbSize)
{
__asm
{
mov eax, 000011f6h
mov edx, esp
SYSENTER
}
}
The function could also be written as follows:
void _declspec(naked) __stdcall SendInput(UINT nInputs, LPINPUT pInputs, int cbSize)
{
__asm
{
mov eax, 000011f6h
lea edx, [esp+4]
int 2eh
}
}
|
|
|
|
|
at least it looks like you know what you are doing
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
that extremely classic programming.. great!
|
|
|
|
|
You're just too good.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I got a error testing funcions Randor made... What can it be?
'SendInput' : redefinition; different basic types
winuser.h(5297) : see declaration of 'SendInput'
I'm coding C
|
|
|
|
|
It means 'SendInput' is already defined. Rename the function to somthing other than SendInput to avoid the conflict.
-David Delaune
|
|
|
|
|
I am wondering why you are suggesting inline assembly to do this as OP already has access to SendInput() API.
|
|
|
|
|
Im not suggesting inline assembly.
I instructed the poster on how to use the SendInput() function and presented several other options. I am simply sharing my knowledge.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi! Everybody,
I am new to programming and this is my first post here. I have problem with assigning a string which is returned by the active component to my edit control box. I will appreciate any hint if possible.
I have created a dialog based MFC standard application and I am using a button to simulate the problem by clicking on the button, but without any progress. This is the description of what I have done:
- Created a C++ dialog based MFC application
- inserted an ActiveX component and created a member variable called “m_Active“
- inserted an edit control and created a member variable called “m_Edit”
- inserted a button and crated a member variable called ”m_Button”
void CTestDlg::OnBnClickedButton()
{
// TODO: Add your control notification handler code here
m_Active.mConnect(0);
m_Active.mListening(1,2000);
m_Active.mStartServers(1,2001,2002,2003);
m_Active.mStreamVideo(1);
m_Active.mStreamAudio(1);
m_Edit.SetString(mGetLocalHostName);
}
……………………………………………………………………………………………………………………
Every thing works fine untill the last line
M_Edit.SetString(mGetLocalHostName);
I have to add that “mGetLocalHostName” forces the ActiveX component to return the string wich I am intending to have in the Edit control.
I hope I have been able to describe the problem I have. And I appriciate any kind of help.
|
|
|
|
|
Hamid intact wrote: inserted an edit control and created a member variable called “m_Edit”
What kind of a member variable is m_Edit? Since you are calling SetString() upon that member variable, I am assuming it is a COleVariant . Try using a control variable instead of it and call SetWindowText(mGetLocalHostName) on it instead.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Rajesh!
Thank you for showing interest in this problem.
I did the changes you suggested.
“m_Edit” is a control variable member now. And after changing the code to
void CTestDlg::OnBnClickedButton()
{
// TODO: Add your control notification handler code here
m_Active.mConnect(0);
m_Active.mListening(1,2000);
m_Active.mStartServers(1,2001,2002,2003);
m_Active.mStreamVideo(1);
m_Active.mStreamAudio(1);
m_Edit. SetWindowTextW(m_server.mGetLocalHostName);
}
I get an error which says:
error C3867: 'CTestserver::mGetLocalHostName': function call missing argument list; use '&CTestserver::mGetLocalHostName' to create a pointer to member
Could you please lead me to a solution?
With thanks in advance.
|
|
|
|