|
|
How to insert a hotkey (Eg. Ctrl+U)in a menu item (through code) in vc++.
|
|
|
|
|
|
hi
i am doing reading frame by frame using avcodec, posting the data for rendering. i am getting the video properly but i am getting memory leak in bitmapinfo
i am using bitmaps for drawing the image.
please help me to how to over come that.
thanks
|
|
|
|
|
adiveppanavar wrote: memory leak in bitmapinfo
How do you use it (i.e. post the relevant code.)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Is it possible we see your code?how did you try?
|
|
|
|
|
Hi adiveppanavar!
I'm also dealing with avcodec to convert a video file to the other format. COuld u help me out plz?
U'r help would be highly appreciated.
thanx
Come online at:-
jubinc@skype
|
|
|
|
|
adiveppanavar wrote: i am getting memory leak in bitmapinfo
How are you verifying this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi
I want to connect to MySQL database when i click a button in MFC dialog based application.
1)I searched web (including CP) but i didn't find exact info since there seems to be various methods to connect including DSN less (using MySQL++)
2)I have downloaded MySQL database & ODBC connector but i am not able to connect to it even while creating DSN(From Control Panel).
3)I am able to create tables etc on MySQL command line but not able to establish link between database & VC++ App.
Can anyone point me to a simple article which explains connecting to MySQl and inserting a record into it(with DSN or without DSN)
thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
MySql installation will provide you with soem documentation for api's to be used for all operations with MySql Database.
Some of them are
void *mydata;
mysql_init((MYSQL*) 0);
mysql_real_connect((MYSQL*) myData,dbHost,dbUID,dbPWD, NULL, MYSQL_PORT, NULL,0);
mysql_select_db( (MYSQL*)myData,"MYSQL");
mysql_query((MYSQL*)myData, "select * from mysql.host");
Saadhinchaali
|
|
|
|
|
|
See Using Visual C++ 6.0 to connect to MySQL[^].
<blockquote class="FQ"><div class="FQA">QuickDeveloper wrote:</div>"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"</blockquote>
if you find your name in that list do you go to work if see your name in the middle of list?
|
|
|
|
|
QuickDeveloper wrote: I want to connect to MySQL database when i click a button in MFC dialog based application.
So what are you having trouble with: 1) connecting to the data source, or 2) responding to a button click?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: 1) connecting to the data source,
Connecting to the datasource while creating DSN
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
One way is to create a CRecordset -derived object. ClassWizard (Ctrl+W) will ask you what DSN to use.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This type of construction so that a function with an indefinitely long parameter list can pass those parameterson to another function:
/*-----*/
void diprintf(HWND db,short c,char*fmt,...){char C[256];
vsprintf(C,fmt,(&fmt)+1);
SetDlgItemText(db,c,C);};
/*-----*/
short discanf(HWND db,short c,char*fmt,...){char C[256];
GetDlgItemText(db,c,C,256);
C[255]=0; return vsscanf(C,fmt,(&fmt)+1);}
/*-----*/
worked fine for me under Gnu C++ and Borland 4.5 C++, but my (free version) Visual C++ 2008 refused it with these error messages:
1>c:\2d\ppp_vc\ppp_vc\ppp.cpp(274) : error C2664: 'vsprintf' : cannot convert parameter 3 from 'char **' to 'va_list'
1>c:\2d\ppp_vc\ppp_vc\ppp.cpp(277) : error C3861: 'vsscanf': identifier not found
(plus the expected complaints about having char* instead of WCHAR* .)
I cannot find the info that I need in the online help.
Please what should these two funtions be corrected to for my Visual C++ 2008?
|
|
|
|
|
Anthony Appleyard wrote: cannot find the info that I need in the online help.
See there http://msdn2.microsoft.com/en-us/library/28d5ce15(VS.71).aspx[^]
the sample code looks promising
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Anthony Appleyard wrote: 1>c:\2d\ppp_vc\ppp_vc\ppp.cpp(274) : error C2664: 'vsprintf' : cannot convert parameter 3 from 'char **' to 'va_list'
So have you looked at the prototype for vsprintf() to see what it is expecting as arguments? The error messages seems fairly self-explanatory.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to get the choosed menu's caputer,then to modifly StatusBar's info.
At Event: OnMenuSelect(UINT nItemID,UINT nFlags,HMENU hSysMenu)
I write
void CMainFrame::OnMenuSelect(UINT nItemID,UINT nFlags,HMENU hSysMenu)
{
CString str;
CMenu* pMainMenu = GetMenu();
CMenu* pSubMenu = pMainMenu-> GetSubMenu(nItemID);
pSubMenu->GetMenuString(nItemID,str,MF_BYCOMMAND);
}
But when compile to the " pSubMenu->GetMenuString(nItemID,str,MF_BYCOMMAND);
" It aways tells me wrong ,I don't know why?help!! thanks!
|
|
|
|
|
vernchen wrote: But when compile to the " pSubMenu->GetMenuString(nItemID,str,MF_BYCOMMAND);
" It aways tells me wrong ,I don't know why?
Without an actual error message, neither do we.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I have a function that calculated two int values. I call the function only by using a string and calculated those two int values. I want to return that two int values from the function when I call it with a string.
Look at the following function,
bool CharWordCount(string rtf, int& word_count, int& char_count)
{
}
<pre>
One of my friend say i can do it as above. using the bool type return value. Can you guys give me a help how to do that.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: One of my friend say i can do it as above.
Sure.
Assign the values you computed to word_count and char_count , respectivly.
And read a book like "C++ for Dummies" or "C++ in 21 days". Esp. the chapter about giving parameters to functions "per value" and "per reference".
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: Assign the values you computed to word_count and char_count, respectivly.
Yes, that is true and can do that and get values. What I'm asking is can I handle it using a bool operator, as I code on my question.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: What I'm asking is can I handle it using a bool operator
What do you mean? Your code is not showing the bool operator. That would be:
operator bool() const
{
} In your example, you assign the values and return a bool . Thats it.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
You can handle it as void, as bool or as you want. I.E. if you check the values of word_count and char_count before going out that function you can return FALSE if there was an error or TRUE if all worked good.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|