|
Django_Untaken wrote: What could be the cause for these debug assertions Anything at all. You need to look at the code in order to find out what they are complaining of, and use your debugger to try and resolve them. However, since this is open source you would be better asking the question at the site where you got the code from.
Veni, vidi, abiit domum
|
|
|
|
|
Hello all,
I am using CDHtmlDialog to create a simple MFC app. I want my app to do the following things.
Load images by using the MFC code to the DHTML page.
Change texts in the DHTML page using the MFC code.
Capture DHTML button cicks inside the MFC code and based on that change the images & texts.
For the 1 & 2 i am planning to do that inside a TIMER or Thread and dynmically change them for user.
I am able to make a simple app, but what am struggling with is changing the images & texts in DHTML page from the MFC code.
Can someone tell me how to do that?
A sample app or code will be great.
Thanks in advance.
|
|
|
|
|
|
No profile, 7 messages, a name like 'Don Guy' and English is not your native language?
Go on, stop pretending to be American in order to get your quesitons answered. Tell us who you really are.
modified 3-Sep-13 9:52am.
|
|
|
|
|
Hi,
i need to create multithreaded environment in my Unit-testing activity. For that i need to create multiple threads which can handle methods individully. And these mthods having different parameters & return types. So as per requirement i'm trying to create thread by using CreateThread().HEre the the thread can handle mehtod like in this format "DWORD WINAPI Function( LPVOID lpParam )
"
Hence my questrion is that , how can we create thread using C++ to hadle method having 'different type of method parameter' & 'method return type' as well.
Please help me soon. Thanks
|
|
|
|
|
pk jain wrote: how can we create thread using C++ to hadle method having 'different type of method parameter' & 'method return type' as well. You don't; you create function calls to call different functions/methods. Running such calls in different threads may or may not be necessary, depending on the test environment.
Veni, vidi, abiit domum
|
|
|
|
|
I can help you in threading because your problem is simple, I would do this with a task object queue (threadpool) but do you think you need multithreading for this? You are calling different methods of objects from different threads within the same process? You can test only threadsafe methods that don't interfere with each other this way. I would rather do this with multiprocessing instead of multithreading. You start several processes each of them performing a different test. This way each process has only one main test thread but these main/test threads dont interfere with each other because they are isolated in separate processes. Sometimes multiprocessing is the winner especially when you are using a non-threadsafe library. So why do you want to use multithreading?
|
|
|
|
|
And these funcitos he is tesing are going to run in seperate processes are they? How likely is that? Perhaps they do share data and use mutexes to manage this and the entire POINT of testing is to make sure they work in the SAME process? Ever thought of that?
|
|
|
|
|
Thanks again for your comments. Have you finished reading my post? The last question tries to find out the intentions of OP. Most of the well written modular multithreaded applications are built up from single threaded components containing the least possible locks and synchronization points between threads that work with separate instances of these single threaded modules. Since the components are usually single threaded most of the test cases are also single threaded and test the functions of a module. It's okay to create a few test cases to test the multithreaded interactions and synchronization points but this won't be the majority of the test cases. Parallelization of test cases within a single threaded component can be achieved safely only with multiprocessing. Actually I've worked on systems that were developed with lots of test cases and some of these systems were multithreaded and some of these were well designed at the same time.
|
|
|
|
|
Fortunately opinion and fact are two different things.
|
|
|
|
|
If you think this then you have no clue about correct multithreading. BTW, returning to your first reply: have you read my first answer?
|
|
|
|
|
Fortunately opinion and fact are two different things.
|
|
|
|
|
If you think this then you have no clue about correct multithreading. BTW, returning to your first reply: have you read my first answer?
|
|
|
|
|
I have done threadding that would make your eyes water.
|
|
|
|
|
I'm not really interested in your threading. BTW, returning to your first reply: have you read my first answer?
|
|
|
|
|
Sounds fairly basic to me, did you think of passing a context to each thread, with the context consisting of the function address to call and the parameters needed?
|
|
|
|
|
You don't need to change the param & return types of the thread function. leave them as it is.
Just imagine the thread function as a platform to launch your test cases - which would be different functions. Just like the post above, I would choose to go with a data structure that takes in all the parameters required to execute the test case. Including the function pointer. If you are bothered about using function pointers you can even have a switch case block that directs the incoming structure-data to the right function using a normal function call. (it's not the best design I'd say, but it still works).
WORD WINAPI Function( LPVOID lpParam)
{
testcaseData ptcdata* = (testcaseData*) lpParam;
ptcData->Data1, data2.. etc
switch(ptcData->tcID)
{
case 0:
TestCase0(...)
case 1:
}
}
And you can use the same Test case index to fill in a Results-vector or list , where it updates the result of the particular test case. The vector can be global or be part of the struct & be protected by a critical section block inside the thread.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
Hello. I am trying to play a wave stream through WASAPI. I am trying to use the code available in online msdn. Here is what I am trying.
hResult = pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, 1000000000, 0, pWaveFormatEx, NULL);
if(FAILED(hResult)) return;
UINT nTotalBufferSize = 0;
pAudioClient->GetBufferSize(&nTotalBufferSize);
IAudioRenderClient *pAudioRenderClient = GetRenderClient(pAudioClient);
BYTE* pData = NULL;
hResult = pAudioRenderClient->GetBuffer(nTotalBufferSize, &pData);
hResult = pAudioClient->GetService(IID_IAudioRenderClient, (void**)&pAudioRenderClient);
if(FAILED(hResult)) return;
::memcpy(pData, pDataPCM, nTotalBufferSize);
hResult = pAudioRenderClient->ReleaseBuffer(nTotalBufferSize, 0);
hResult = pAudioClient->Start();
DWORD dwFlags = 0;
while(TRUE)
{
::Sleep(500);
UINT nFramesPadding = 0, nFramesAvailable;
hResult = pAudioClient->GetCurrentPadding(&nFramesPadding);
TRACE("%d\n", nFramesPadding);
}
hResult = pAudioClient->Stop();
I am NOT getting any error but I cannot listen to the buffer as well. So what should I do in the loop to listen to this buffer? Thanks.
This world is going to explode due to international politics, SOON.
modified 2-Sep-13 1:33am.
|
|
|
|
|
What is the difference between the "edit mask" and the "edit template" when using the masked edit control in the MFCPropertyGridProperty control?
See: http://msdn.microsoft.com/en-us/library/bb983599.aspx[^] The documentation is quite sparse for this control.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
Thanks, I didn't think to look there!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Why we use destructors???and what functionality they perform???
|
|
|
|
|
|
Destructor is a function that is automatically called (by the compiler) when an object on the stack goes out of scope or when delete is called on pointer pointing to an object of a class.
Destructors are normally used to perform cleanup on the object.
Destructors along with constructors form an important concept in C++ called Resource Acquisition Is Initialization or RAII - http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization[^]
This concept is used a lot in several C++ libraries like the STL and Boost.
|
|
|
|
|
Destructor - cleans memory occupied by Object.
|
|
|
|