|
Hi all,
i am Encoding media files using WMSDK.As given in SDK Help i am using IWMEncoder interface for encoding. as part of that example
<br />
hr = pEncoder->Start();<br />
<br />
printf("When encoding stops, press a key to close the console window.");<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
while(!kbhit())<br />
_asm nop;<br />
<br />
hr = pEncoder->Stop();<br />
}<br />
i don't wants to use kbhit() and wants to complete hole file encoing process automatically.
For that we have functions put_Autostop() and get_Autostop() but there are not working properly.
So if anybody has an idea about that give plz.
|
|
|
|
|
when i do write the following:
m_pRecordset->Open("CREATE TABLE MY10151109(ID INT,Hex_Fangwei TEXT,Hex_FuYang TEXT,Hex_QingXie TEXT)",
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
it runs OK;
but when i do it like this:
CString mstr;
mstr.Format("CREATE TABLE '%s'(ID INT,Hex_Fangwei TEXT,Hex_FuYang TEXT,Hex_QingXie TEXT)",TB_Name);
m_pRecordset->Open(mstr.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
appear runtime error
who could tell me why , and what should i do?
wuhuaiji
|
|
|
|
|
nibabug wrote: m_pRecordset->Open(mstr.AllocSysString(),
try putting mstr there and see
i.e. remove .AllocSysString().
AFAIK it should work.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
<br />
void func()<br />
{<br />
struct SInfo SOCKINFO;<br />
SOCKINFO.pThis = this;<br />
SOCKINFO.ClientSocket = sockClient;<br />
strcpy(SOCKINFO.szClientIP, szClientIP);<br />
memset(SOCKINFO.szMessage, 0, BUFFER_SIZE);<br />
hThread = (HANDLE)_beginthreadex(NULL, 0, WorkThread, (LPVOID)&SOCKINFO, 0, NULL);<br />
}<br />
but,when WorkThread() is running,I'm worried about func() have been finished result in "struct SInfo SOCKINFO" be released.That's WorkThread() must be obtain a correct "struct SInfo SOCKINFO"?
UINT CServerSocket::WorkThread(LPVOID pParam)<br />
{<br />
struct SInfo Param;<br />
struct SInfo *lpParam = (struct SInfo*)pParam;<br />
}
-- modified at 23:16 Sunday 14th October, 2007
|
|
|
|
|
Allocate SOCKINFO on the heap and pass its address.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
how to add different Right menu for different area in a MFC UI Procedures,in order to achieve different control and operation.
For example ,A Tree List Control,when I Selecte one type of node ,I want it can Show one type of Right menu ,and if I select another type of node ,I wan it to show another kind of Right menu .
How to achieve it?Please Help me,thank you ~
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
You can: 1) create a different context menu at design time and bring up the one you need, or 2) create one context menu at design time and modify it at runtime, or 3) create the whole menu at runtime.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
你可以为每一种邮件添加一个资源菜单,根据不同的item,load相应的resource ID
POINT point;<br />
UINT uFlags;<br />
<br />
GetCursorPos(&point);<br />
<br />
m_ctrlTree.ScreenToClient(&point);<br />
<br />
HTREEITEM hItem = m_ctrlTree.HitTest(point,&uFlags);<br />
<br />
if(hItem)<br />
{<br />
hTreeCurrent = hItem;<br />
ClientToScreen(&point);<br />
<br />
VERIFY(menu.LoadMenu(IDR_TREERCLK));<br />
pPopUp = menu.GetSubMenu(0);<br />
}
|
|
|
|
|
ありがとう
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
감사합니다
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
I have a dialog template with some control on it.
When I will press a button on this dialog, I want to clone this parent dialog and modied some of its control and display this clone dialog as a modal or modeless. At that point I have two dialog one is the original and another is the clone version with some modification.
I will appreciate your help.
Thank you.
|
|
|
|
|
Can't you just create another dialog template with the modified controls on it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My first dialog is resource based. I want to clone it after it is instantiated.
Are you suggested, to get the dialog template of the existing dialog and create indirectly anothe dialog. How I can get the controls and their current status of the first dialog.
Do you have any more idea? Is it possible to implement a copy constructor?
Thank you for your suggestion.
|
|
|
|
|
If you make the Dialog in your resources... Why don't you create a second dialog based on the first but with th modifications you need?
It will be the simplest way, with two different dialogs.
Other solution may be to create the dialog dinamically, derive it from the first one, and add all the controls and modifications you need through code. But I find much easier doing it with just 2 dialogs, and call the one you need when you need.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
s196675m wrote: How I can get the controls and their current status of the first dialog.
GetWindowText() , GetChecked() , GetCurSel() , etc.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is there any reason I can't take a Snapshot of a suspended process?
It gives me error 299, "Only part of a ReadProcessMemory or WriteProcessMemory request was completed."
Arrgg!
|
|
|
|
|
Independent123 wrote: Is there any reason I can't take a Snapshot of a suspended process?
It gives me error 299...
CreateToolhelp32Snapshot() is producing error 299?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: CreateToolhelp32Snapshot() is producing error 299?
Yes, that's correct. I try to use it to create a snapshot of all the modules in a suspended process, and it gives that error.
However, when I resume the process, there is no error.
EDIT:
I just found the answer: It works by injecting code into the process, so if the process is suspended, it can't function.
|
|
|
|
|
Hello
(It maybe not related to this board, but I'm sure there is many intelligent person they can help me)
I need to know how to use a HTTP proxy server to mack a socket like connection for example for contact a whois server.
thanks you very much
Iman Ghasrfakhri
|
|
|
|
|
You can't. For general purpose socket communication for non-HTTP protocols, you need a SOCKS[^] proxy.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hello everyone,
I am developing C++ COM native code (unmanaged C++) using Visual Studio 2005. I do not take any new features of 64-bit platform, and currently my code runs fine on 32-bit platform (e.g. Windows XP SP2).
Now I am researching how to build my code for 64-bit platform (e.g. Windows 2003 Server 64-bit R2)? Any options I need to specify in Visual Studio 2005? The best solution to me is to make a single build for both 32-bit and 64-bit platforms, is that possible?
thanks in advance,
George
|
|
|
|
|
32-bit code will run on 64-bit platforms. However, 32-bit DLLs can only load into 32-bit processes and 64-bit code into 64-bit processes, you cannot mix them. A single build is impossible if you want your code to load into a 64-bit process.
Firstly you have to pick the sort of 64-bit platform you're supporting. Windows runs on two, x64 and Itanium. Itanium is very expensive and rare - commodity 64-bit platforms are x64. (If you can boot the 32-bit OS on it, it's x64.)
In Visual Studio 2005, go to Build/Configuration Manager. In the Active Solution Platform drop-list, select New. Then select 'x64' from the 'Type or select the new platform' drop-list. If it's not present you may need to re-run Visual Studio setup and install the x64 compiler toolchain. When you click OK, Visual Studio changes the active configuration to x64 and will use the x64 compiler to build your solution. To swap between the compilers, select the appropriate configuration from this dialog or use the equivalent drop-down list in the standard toolbar.
You may need to refine your build settings slightly. If you change them in future you will need to change them for both platforms, they are not copied between the two. You can do this manually or you can select All Platforms from the Platform drop-list in Project Properties.
If you're dealing with old code, you may have to change some datatypes, whenever dealing with a variable that can hold an integer or a pointer, or that is of a type that is supposed to be able to hold the complete range of pointer values, e.g. you may have used an int for the return value of strlen , whereas it should really be a size_t , which is 64 bits on 64-bit Windows. Other places to be aware of are in handling window messages - LPARAM and WPARAM extend to 64 bits (WPARAM remains unsigned while LPARAM remains signed) - and in the use of context parameters, which commonly change to DWORD_PTR to reflect that either a numeric value or a pointer is acceptable.
The 32-bit compiler generates 64-bit portability warnings if the /Wp64 switch is enabled, but reportedly this is not as extensive as actually using the 64-bit compiler itself. As always it's best practice to compile with a high warning level (level 4 if you can) and ensure that the code compiles with no warnings.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Thanks Mike,
Your reply is so great and deserves the highest rating!
Two more comments,
1. I am developing plug-in for other application (process), and if the process itself is 64-bit on 64-bit platform, I need to re-build my DLL to 64-bit, right? Since 64-bit process can not load 32-bit DLL?
2. I have tried to create new configuration for 64-bit platform in Visual Studio 2005. I have tried that I could copy settings from existing configurations, so I copy 32-bit debug configuration to a new 64-bit debug configuration. Is it the correct operation?
In my environment, the choices are,
Mixed platforms
Any CPU
x86
x64
Win32
I want to confirm with you that I should select x64, right? What means Mixed platforms and Any CPU?
regards,
George
|
|
|
|
|
1. Yes, that's correct.
2. It sounds like you have a mix of native C++ and .NET projects in your solution. For this you'll probably have to define each of the projects manually (use the Platform drop-list next to each project in Configuration Manager).
Off-topic for this forum but relevant to your project: .NET code is inherently processor-independent - it's compiled for the specific processor architecture at runtime - but you may need to mark your code for x86 or x64 as appropriate. By default it's 'Any CPU', that is, it can run in either a 32-bit or a 64-bit process. If this is a class library (a DLL) it will be compiled to the right architecture for the process it's being loaded in. An EXE will be compiled to 32-bit code on a 32-bit OS, and run as a 32-bit process, and as 64-bit code on a 64-bit OS (and run as a 64-bit process).
You should check your .NET code for anywhere it invokes native code or makes use of the size of a pointer - perhaps casting an IntPtr to a specific-sized integer? - to ensure that you've defined the arguments correctly. Always use IntPtr when it's a pointer parameter.
If required to do things differently on the different platforms, you can mark the code explicitly as x86 or x64. You might do this if there's a function that you need that's only implemented on one or the other.
I'm guessing 'Mixed Platforms' is when you have some projects in the solution set for one platform and some for another.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|