|
Hi,
How can i Set Ethernet adapter (NIC) NDI Params from application ( C/C++ ),
Params are ConnectionType, EnableTagging, VLANID etc'.
|
|
|
|
|
I hope all tree items on context window of html help are expanded when the help pops up.
normally tree items of context window are collapsed.
do you know how to do that?
thx
includeh10
|
|
|
|
|
Check out this website.
http://www.mvps.org/htmlhelpcenter/
I found the sample projects to be useful even though the tutorials are not that great. I was looking at htmlhelp recently and did not get much help from the newsgroups nor could I find much on the web. But the C++ example here was quite useful, so you can download it, compile it, and use the debugger to figure out what is going on.
When you use the htmlhelp api to to tell your program to display a particular help file, within the htmlhelp window, it will expand the table of contents for you. I don't do anything specific to make it happen; it just does it. I implemented context help to allow me to press the '?' button on the upper right of my window and then when you select a dialogue item, it will call the html api function like so...
That is one example; you might have switch statements or some pattern for interpreting the ID of the resource and then calling the appropriate version of ::HtmlHelp. Notice the '::'. I am using the global api function. There is an HtmlHelp function built into the mfc classes as well and I do not use those. I use the global function. Why? Cause it just works for me, I guess.
Here is some example code. You see I am responding to the OnHelpInfo method in my dialog class. I setup the help path to my .htm file and then when I call ::HtmlHelp at the bottom, it will open the main html help window with the table of contents displayed and it will expand them to the file I am telling it to display specifically.
Hope that gets your started. That's all I know; and the htmlhelp documentation, that I have found, really stinks. So I learned how to do things using the example code on the aforementioned website. I still have no idea how it really works.
BOOL CDataReductionDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
CWinApp* theApp = AfxGetApp();
//Get the help file name
CString sHelpFilePath = theApp->m_pszHelpFilePath;
//sHelpFilePath += _T("::/hid_sc_size.htm");
switch(pHelpInfo->iCtrlId)
{
case IDC_START_DAY:
case IDC_SPIN_START_DAY :
case IDC_START_HOUR:
case IDC_SPIN_START_HOUR:
case IDC_START_MINUTE:
case IDC_SPIN_START_MINUTE:
case IDC_START_SECOND:
case IDC_SPIN_START_SECOND:
case IDC_START_MILLISEC:
case IDC_SPIN_START_MILLISEC:
case IDC_END_DAY:
case IDC_SPIN_END_DAY:
case IDC_END_HOUR:
case IDC_SPIN_END_HOUR:
case IDC_END_MINUTE:
case IDC_SPIN_END_MINUTE:
case IDC_END_SECOND:
case IDC_SPIN_END_SECOND:
case IDC_END_MILLISEC:
case IDC_SPIN_END_MILLISEC:
case IDC_STATIC_FILESTART:
case IDC_STATIC_FILESTOP:
sHelpFilePath += _T("::/task_ex_time_segments.htm");
break;
case IDC_BROWSE_INPUT:
case IDC_FILENAME_OUTPUT:
case IDC_BROWSE_OUTPUT:
case IDC_FILENAME_INPUT:
sHelpFilePath += _T("::/task_ex_file_selection.htm");
break;
case IDC_JMSG_FILTER :
case IDC_GWMSG_FILTER:
sHelpFilePath += _T("::/task_ex_using_filters.htm");
break;
case IDC_CANCEL_BUTTON:
case IDC_START:
sHelpFilePath += _T("::/task_ex_output_desc.htm");
break;
default:
break;
}
//If no additional topic was appended to the help path, then the default
//topic will be displayed.
::HtmlHelp(m_hWnd,
sHelpFilePath,
HH_DISPLAY_TOPIC,
NULL);
return TRUE;
}
|
|
|
|
|
digwizfox,
really thans for your long reply.
i will try your comments soon.
cheers.
includeh10
|
|
|
|
|
Hi,
I want to select a particular part of the image by drawing a frame around them(like in paint brush) or by clicking on two points on the image to indicate the range of selection. I do not know how to do it in VC++ and also I am using CXIMAGE for processing images. Please do help me, I know this is big...but please give me some tips.
Thanks in advance
|
|
|
|
|
I met with the same problem
I wonder if someone got the solution,or the update vision has new functions about that,
for I'm just starting with this class,hope someone can give some clues for that.
Appreciate!
modified on Monday, July 20, 2009 8:34 AM
|
|
|
|
|
I am writing a small test app' and while trying to debug I get the message "Please enter the path of the vc60.pdb" when I select my /debug folder it then shows "A file with the correct name was found, but it is not the correct one." Anyone got any idea what project settings are causing this?
|
|
|
|
|
hi,
I do also get this message when doing my project, even though the file is actually present in your DEBUG folder. Click on CANCEL button on the message box of "PLEASE ENTER THE PATH OF VC60.PDB", then it will work. Do not worry, this will never show up in the executable file. Hope this works for you...as it does work for me.
Good Luck
|
|
|
|
|
Thanks. That is what I did, but why does it happen and how are you supposed to resolve it properly so it doesn't keep happening?
|
|
|
|
|
Try doing a 'rebuild all'. I've also seen this occur when the file was marked readonly, and didn't get rebuilt properly.
Software Zen: delete this;
|
|
|
|
|
hi!
i have made an application in visual c++ which contains two dialog boxes each with different contents.... i have also added a menu which interchanges the two dialog boxes... in the menu i have added two tabs one named normal and the other named special.... the two dialog boxes have the id's IDD_NORMAL AND IDD_SPECIAL....for normal tab i have added text
EndDialog(IDD_SPECIAL);
int result=IDD_NORMAL;
CDialog dlg(result);
result=dlg.DoModal();
and approximately the same code for Special tab....
the problem is that for the first time the dialog box works fine ie it interchanges but when again i wish to change the dialog , the other one remains and doesn't end.... wat should i do and yeah as i have written the code with the help of somebody ... i don't know the meaning of the statement
CDialog dlg(result)
please do explain
thankyou
haseeb
|
|
|
|
|
I hope you did not write it as shown in this post. The idea I gave you should have worked, here is a rewrite (of an dialog-app InitInstance fuction):
BOOL CVeryTemporaryApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
int nResponse = IDD_NORMAL;
while (nResponse == IDD_NORMAL || nResponse == IDD_SPECIAL)
{
{
CVeryTemporaryDlg dlg((UINT)nResponse);
m_pMainWnd = &dlg;
nResponse = dlg.DoModal();
}
}
return FALSE;
}
In the above example: the response from DoModal() should be IDOK, IDCANCEL, IDD_NORMAL or IDD_SPECIAL, anthing else is invalid.
As for EndDialog(IDD_SPECIAL), this causes dlg. DoModal() to return IDD_SPECIAL as the response code.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
please can anybody tell me how to control the execution speed of a processing loop regarless of the cpu speed for the machine?
i am working on a program that animates pictures, and when i move the program to a computer with fast cpu it executes too fast, the animation is destroyed!
timers dont work well for they cant respond for less than 50 ms.
i need an effective control over my code execution speed.
any feedback is welcome.
thanx all
Mohammad Gdeisat
a candle looses nothing by lighting another candle
|
|
|
|
|
i think that you should make a counter for the number of pics dislayed in the current second, if the couunter is greater then , let's say 25, do nothing. If a second elapsed reset the counter to 0 and do the same process...
actualy this must work because is a graphics technique
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
This problem is as old as computers. We used to write code to do everying thing as fast a possible, because they where to slow. Now they are to fast.
1) You could do your animation in a seperate thread and use Sleep().
You might start by looking up "thread classes" in the MSDN library, then go onto look at other methods of handling threads.
2) (NO LONGER RECOMMENDED - BUT WORKS)
An older method that is not used much any more (I think) is to handle message passing in your own proccessing loop. This method has been used offten in game programing.
int Wait(DWORD dwDelay)
{
clock_t nGoal = clock() + dwDelay;;
if( PeekMessage(&msg,NULL,0,0,PM_REMOVE) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if( msg.message == WM_QUIT )
return -1;
.....
if( clock() >= nGoal )
break;
}
return 0;
}
void ShowAnimation(...)
{
....
ShowFirstFrame(...);
for( ;; )
{
ShowNextFrame(...);
...
if( Wait(...) < 0 )
break;
}
}
This sample above uses the clock function but you could also use the mulimedia timer (See "Using Multimedia Timers" in MSDN).
How you apply apply the message passing code in your own code is up to you.
------------------------------------------------
Well that enough, there are probably other ways to accomplish this.
P.S. There are lots of sights (and books) dedicated to game programing and animation.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanx friend,
I am already using Sleep() function in my animation program, furthermore, i calculate CPU clock speed and pass the number of milliseconds to Sleep according to the processor speed, and it works good.
But the problem is Sleep has a waiting loop, this loop captures some of CPU time, although i am not a professional programmer, i feel that there must be a way to use the cpu more efficiently.
what i mean here, if the program runs on a fast computer, and it wants to display just 1 frame/s, it will capture all free CPU time because this is the way Sleep works-its a loop.
I need a technique that will use cpu time just as needed, I dont want to waste any CPU time.
thanks for your time and patience.
|
|
|
|
|
Mohammad A Gdeisat wrote:
But the problem is Sleep has a waiting loop, this loop captures some of CPU time, although i am not a professional programmer, i feel that there must be a way to use the cpu more efficiently.
Don't you have something similar to:
while (more_pics == TRUE)
{
DisplayPic();
Sleep(1000);
} This should render a new picture every second regardless of the CPU speed.
I don't know how you've determined that Sleep() uses any CPU time because it does not. You can easily verify this by running the following code and using Task Manager to watch the CPU usage of the running processes.
void main( void )
{
for (int x = 0; x < 10; x++)
Sleep(2000);
} Looking at the Performance tab, the CPU usage should stay in the 3-4% range.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanx friend,
i think you are right, but i dont know why does my program capture 100% of available CPU resourses although it has Sleep in its loops!!!
I imagined that a simple animation with sleep would take at most 30% of CPU time on a 2GHz Intel P4 processor.
I am confused!!!!
thanks for your note
|
|
|
|
|
Without seeing your actual code, it's hard to say.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all,
I was wondering if there is any way to register file type and icon other then adding keys to HKEY_CLASSES_ROOT\filetype.
The problem is that program I'm writing supposed to run under user mode credentials and application doesn't have any rights to add this registry values to the system registry.
Thanks in advance.
-wz.
|
|
|
|
|
|
Dear friends,
I developed an application in Visual C++. The application is completed and successfully deployed. Clients are satisfied as all their requirements are fulfilled.
In our application, there is a feature of 'scripting' i.e Users can enter their formula using VBScript , and then our application loads the script dynamically and executes it.
Now the problem is that users are having problem while manually entering formula. Users don't know how to code in VBScript. Ofcourse, VBScript is easy for all of us; but not for the general public.
Now you can say that we should hardcode all the formulas..no..this is not possible. Users define their own conditions using the formulas, ard there can be thousands of conditions..and..thats why we provided them scripting support.
We want to make the process of formula creation, somewhat user friendly. And i want your suggestions in this regard. If you know any such application that provides userinterface for entering formula, then please tell me about it, so that i can take impression from it. And please give your advices in this regard.
Thanks a lot.
Imtiaz
|
|
|
|
|
what do you mean by "general public" ?
as soon as there's an option for the user to enter new commands ( in you case, formulas ), it is a feature for power users; meaning that the user who need to enter such data will need to work a bit on their side to learn the scripting language, especially if it was part of the requirements.
Also, if this feature is really important, then, you can't underestimate the need to ship documentation for the scripting language, with as many example and sample you can offer.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Why not create a form or dialog or even a wizard that walks the user through creating a formula with drop downs, checkboxes, ie. standard UI controls and create the script behind the scenes? That allows your users to create custom formulas and at the same time, prevents them from having to learn a scripting language.
|
|
|
|
|
Why not provide a "tutorial by example" first?
Much more powerful than a wizard
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|