|
Hi
I'm trying to do some work with AVI files using Visual C++ 5.0 while running Win XP. I've been having a lot of problem and a few posts I've seen suggest that I'll need to upgrade to version 6.0 to use some of the features in XP for AVI's.
Does anyone know if this is actually the case?
Confused Kenny
|
|
|
|
|
Is it possible to block packets(Forcing them not to reach their destination)using Winsock API. Plz provide relevent sites containing the help and the source codes.
Reply me soon
|
|
|
|
|
Hello all,
In my project I want to scroll a web page pixel by pixel.
currently i do :
<code>IDispatch *pDisp = GetHtmlDocument();
IHTMLDocument2 *pDocument = NULL;
pDisp->QueryInterface( IID_IHTMLDocument2, ( void** )&pDocument );
IHTMLElement* pBody = NULL;
pDocument->get_body (&pBody );
IHTMLElement2* pBody2 = NULL;
pBody->QueryInterface(IID_IHTMLElement2,reinterpret_cast<void**>(&pBody2));
long ScrollX = 0;
long ScrollY = 0;
long ScrollHeight = 0;
long ScrollWidth = 0;
pBody2->get_scrollHeight(&ScrollHeight);
pBody2->get_scrollWidth(&ScrollWidth);
while(1)
{
..
..
if (ScrollX == ScrollWidth)
{
ScrollX = -1;
ScrollY++;
}
pWindow->scrollTo(ScrollX++,ScrollY);
}</code>
at the beginning it is fast but progressively it is increasingly slow !
, you know how scroll document fastest ?;)
|
|
|
|
|
NetShareEnum fails on calls to machines that are not members of the last domain enumerated by NetServerEnum...
For example, I have a treeview that behaves much like Windows Explorer... the treeview's constructor calls NetServerEnum, which enumerates the 2 domains on my network, and displays each as a node in the treeview...
clicking on a domain node calls NetServerEnum again to enumerate all the machines on that domain... so far so good..
clicking on a machine calls NetShareEnum to enumerate all shared resources on that machine...
My problem is that NetShareEnum only succeeds for machines on the second (last) domain...if I click on a machine under the first domain, I get a return val of 53 - "network path not found"
There is no provision in NetShareEnum to specify a domain, so I'm wondering if I have to call NetServerEnum (just before NetShareEnum) for the desired domain, so I have the right context...???
thanks for any help.
|
|
|
|
|
i want adjust a dialog and his child dialog position,to make them match.
thanks!
|
|
|
|
|
See CDialog::PreCreateWindow() and CREATESTRUCT.
Jon
#include <beer.h>
|
|
|
|
|
You can use SetWindowPos to move the child dialog. I usually put a (non visible)
static control on the parent dialog to be replaced / superimposed by the child
dialog. Roughly:
class CParentDlg
{
...
CChildDialog m_Child;
...
};
BOOL CParentDlg::OnInitDialog ()
{
...
CRect rcStatic, rcChild;
GetDlgItem (IDS_PLACEHOLDER)->GetWindowRect (&rcStatic);
ScreenToClient (&rcStatic);
m_Child.Create (...);
m_Child.GetWindowRect (&rcChild);
ScreenToClient (&rcChild);
m_Child.SetWindowPos (GetDlgItem (IDS_PLACEHOLDER),
rcStatic.left + (rcStatic.Width () - rcChild.Width ())/2,
rcStatic.top + (rcStatic.Height () - rcChild.Height ())/2,
0,0, SWP_NOSIZE);
....
}
I hope that helps. The bit of maths makes the child dialog centre at the same
point as the static centre. Another thing to watch is to set the "Control Parent"
style, so you can tab "through" the child dialog.
Iain.
|
|
|
|
|
I have 2 file list window which are "1FileListCtrl" and "2FileListCtrl"
and I have 2 radio. If I check radio one, I expect 2FileListCtrl window is disable but it is not disable. Do you know how to solve my problem?
These below is my code (when I check radio one)
void CTestView::OnKeyfileRadio() <br />
{<br />
UpdateData(TRUE);<br />
if (m_keySrc == 0) {<br />
1FileListCtrl.EnableWindow(TRUE);<br />
2FileListCtrl.EnableWindow(FALSE);<br />
}<br />
UpdateData(FALSE);<br />
}
This is my picture problem
http://www.geocities.com/foruonlyna/1.JPG
|
|
|
|
|
You code seems to be ok. So you could check if your call to UpdateData(TRUE) is succesfull. And are you sure that 2FileListCtrl is connected to the window you expect it to be? Or do you have another handler for your 2nd radio box, which possibly re-enables your window?
|
|
|
|
|
m_keySrc is your problem. solution:
ooosawaddee3 wrote:
//if (m_keySrc == 0) {
1FileListCtrl.EnableWindow(TRUE);
2FileListCtrl.EnableWindow(FALSE);
//}
|
|
|
|
|
Lazy programmer is looking for way to automate removal of unused code from my MFC VC++ files. Not looking for code beautifier / formater - my code is beyond help here! Willing to build my own but have a little experience in this field. Any constructive suggestions welcomed. Thanks
Vaclav
|
|
|
|
|
Numega BoundChecker comes with "TrueCoverage" and TrueTime.
Both tools pretty good at detecting possibly dead code....
As far as really automated way I don't think so.... Function may be called on some very rare circumstances.
Unless you have very trivial case when function never called from anywhrere, then may be U can use VC parser to parse source, load functions into own hash table, and exclude all messages...
|
|
|
|
|
Hi All,
I wanted to make GUI windows for a console project written that is in C. So I created a simple MFC Dialog Box Application and included all the console project's source files, header files and the library files in to the workspace and called the main(...) function of the console project on the click of a button by passing the command line arguments with it.
The actual C console project, when run in Microsoft Development Editor in both debug as well as release mode, runs perfectly.
If I run the MFC project by pressing F5 in debug mode, it runs well but causes problem when i run the debug EXE from windows explorer. It also crashes when i run it in release mode either by pressing F5, Ctrl F5 or directly run the release EXE from windows explorer.
The problem when i debugged the release mode was that at a certain point, one malloc was returning NULL despite the fact that I have enough memory (256MB) with me.
The malloc is being called from the well running C project file. The same malloc call returns good values for 6 times but returns NULL for the seventh call when i try to allocate just 13 bytes. The problem is not the memory shortage but as i think may be the linking of the C project in MFC environment.
Any help is welcomed...
Deepak Gupta.
Have a Good Day!!!
|
|
|
|
|
Dear friends,
I developed an out-of-proc COM component i.e it is an exe that exposes interface. The clients talk with this component via the interfaces it expose.
Now i want this out-of-proc server to be able to call back its client, i.e i want to fire events from this component. Can any one tell me that how can i do so?? I would be glad if you point me out some sample application.
|
|
|
|
|
i need a functiont that will dial a telephone number or IP address, but i need it to be simple like some kind of DOS command or something like that, my other question is what code can i include to make my password apear like "***" instead of 123, thanks
|
|
|
|
|
There is a check box named 'Password' in edit control, which would help you do that. my previous reply was for c#, sorry
Cheers,
Kannan
|
|
|
|
|
Use RasDial() for dialing a telephone number.
A. Riazi
|
|
|
|
|
let say i had created a thread by
hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
ThreadFunc, // thread function
&lpVoid // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
with thread function
unsigned long __stdcall CProjectv1Dlg::ThreadFunc(void* lpVoid)
{//let say again
while(1){
if(int a == 1)
m_result += " success";
}
return 0;
}
i oso created an editbox with a Cstring variable m_result.
now, my question is how can i update the editbox through the m_result variable?
thks for all the advice and help
regards,
afender
|
|
|
|
|
You can pass dialog class's address as the parameter of the thread function and then through that pointer you can access variables and functions of your dialog class.
C.R.Naik
|
|
|
|
|
You can do it by passing dialog class's address as the parameter to the thread function and then access dialog class's variable through that pointer.
C.R.Naik
|
|
|
|
|
how can i pass the dialog class's address..as in how should i write on the third argument of the createThread()
sorry to trouble again
Regards
afender
|
|
|
|
|
Anonymous wrote:
on the third argument of the createThread()
If you're using MFC inside of the worker thread then call AfxBeginThread to start it. It's the only way you can make MFC objects to acquire correctly the TLS data they use.
rechi
|
|
|
|
|
Simply by putting second parameter of AfxBeginThread as "this". For further process...please refere following replies for this question.
C.R.Naik
|
|
|
|
|
hi
below are the code i had modified
unsigned long __stdcall CProjectv1Dlg::ThreadFunc(void* lpvoid)
{
CProjectv1Dlg *myThis = (CProjectv1Dlg *)lpvoid;
while(1){
if( a == 0){
myThis->myThis = "read success";
myThis->UpdateData(FALSE);
}
}
}
now my problem lies on the myThis->UpdateData(FALSE), it seems i cannot directly use this function. Any other way to update the data?
thks again
afender
|
|
|
|
|
I supposed that ID of your dialog's Edit Box is IDC_EDIT_MYTHIS, then your problem can be solved by the following code :
unsigned long __stdcall CProjectv1Dlg::ThreadFunc(void* lpvoid)
{
CProjectv1Dlg *myThis = (CProjectv1Dlg *)lpvoid;
while(1){
if( a == 0){
//myThis->myThis = "read success";
//myThis->UpdateData(FALSE);
::SetWindowText(::GetDlgItem(myThis->m_hWnd, IDC_EDIT_MYTHIS), "read success");
}
}
}
Welcome
C.R.Naik
|
|
|
|