|
Hi,
I want to link my code with a static library mysqlclient.lib. How d I do this?
Karteek
|
|
|
|
|
Project->Settings->Link
Object/Library Module
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
or just write in your code
#pragma comment(lib,"yourlib");
which does very much the same
|
|
|
|
|
I Use CListCtrl and do exactly these steps:
Make some columns, then add some elements into the controll, then delete them and delete all the column. Then i repeat the same action some time. And i lose some memory on this operation.
Does anybody know what problem do I have with memory leak???
Please Help...
There are some expressions frome my code:
It is a function
void CChanelsSchedul::OnChanelChanged()
{
if(m_ADODatabase.IsOpen())
{
CMainFrame* mainframe = reinterpret_cast<cmainframe*>(AfxGetMainWnd());
CChanels* chanels = reinterpret_cast<cchanels*>(mainframe->m_wndSplitter.GetPane(0,0));
CListCtrl* lcontroll = &(chanels->GetListCtrl());
POSITION pos = lcontroll->GetFirstSelectedItemPosition();
int ID = chanels->ID[lcontroll->GetNextSelectedItem(pos)];
CADOParameter Chanel_ID(CADORecordset::typeInteger,sizeof(int));
Chanel_ID.SetValue(ID);
m_ChanelsSchedulList.DeleteAllItems();
int itemCount = m_ChanelsSchedulList.GetHeaderCtrl()->GetItemCount();
for(int i = 0;i
|
|
|
|
|
Please use <pre> before code and </pre> after code, to preserve code format.
If you break out some of the code and place it in helper functions, you should find it much easier to solve the problem.
If you are not using one of the memory checker programs, then I recommend you download a trial copy of BoundsChecker or MemoryCheck (ect...).
INTP
|
|
|
|
|
Thanks for advise about memory monitoring programm.
And i'll show a shorter programm for convinience:
void SomeFunction(void)
{
m_ChanelsSchedulList.DeleteAllItems();
int itemCount = m_ChanelsSchedulList.GetHeaderCtrl()->GetItemCount();
for(int i = 0;i < itemCount;i++)
m_ChanelsSchedulList.DeleteColumn(0);
m_ChanelsSchedulList.InsertColumn(0,"Programm ID",LVCFMT_LEFT,80);
m_ChanelsSchedulList.InsertColumn(1,"Date",LVCFMT_LEFT,70);
m_ChanelsSchedulList.InsertColumn(2,"Time",LVCFMT_LEFT,50);
m_ChanelsSchedulList.InsertColumn(3,"Week",LVCFMT_LEFT,70);
m_ChanelsSchedulList.InsertColumn(4,"Duration",LVCFMT_LEFT,70);
m_ChanelsSchedulList.InsertColumn(5,"Programm Name",LVCFMT_LEFT,300);
i = counter;
j = counter;
m_ChanelsSchedulList.InsertItem(i,Something);
m_ChanelsSchedulList.SetItemText(i,j,Something);
}
And i Call this function some times, and i notice memory leak.
|
|
|
|
|
Well may be this is the problem:
for(int i = 0;i < itemCount;i++)
m_ChanelsSchedulList.DeleteColumn(0);
for(int i = 0;i < itemCount;i++)
m_ChanelsSchedulList.DeleteColumn(i);
INTP
|
|
|
|
|
Well, i have this question regarding sound, hope someone can help me out:
I have 2 microphones attached to my sound card and one is placed nearer to me and the other one further away. When i make a sound, the 2 microphones will record it. So the question is, how do i compare the 2 sound data to find out which microphone is nearer to me?
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
How the heck did you do that? My sound card has only one input available.
While I haven't a clue how to do this programmatically, from an engineering view I know that you first have to restore the digital signals to raw PCM, then analyze the two separate signals for differences. Two approaches work - phase shift, and amplitude change, as the more distant mic's signal will be both delayed in time and diminished in amplitude. Given the limitations of resolution in digitizing, I think that the phase shift will be more easily detected than the amplitude change. The speed of sound is 331.4 + .6Tc (where T = temperature in C) m/s - the sample rate of the sound card will determine the accuracy possible. As to how you go about accomplishing this in code, I haven't a clue, but it certainly sounds fun. I've been mulling over something just like this for years - a method of tracking people walking across my yard using buried mics and a PC - but I haven't yet begun to actually research the specifics. I'd be very interested in seeing what you come up with!
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Well, i am not too sure about the details though. It is my friend's acadamic project and she is seeking help cos she has neither the programming nor engineering knowledge on this.
From what i heard from her, something like this is already done by a postgraduate, but it isn't real time. Her task would be to make it so. She had approached that postgraduate for some codes but apparently, what she got wasn't enough.
Anyway, thanks for your help. I'll see how much more info i can get. May be posting on this again.
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Your friend should team with an electronics engineering student - they are often required to make something useful as a Senior Project. Real time programs don't fit the Windows model very well, btw - you usually have to resort to a RTOS solution, and most of them support C, not C++. If this is intended to track voice signals, she'll need to sample the signals at an 8 kHz rate as a minimum in order to satisfy the Nyquist theorem, but modern A/D circuits do this easily. I wouldn't try for any higher rate, though, as aliasing will become a problem. I look forward to seeing future posts on this subject - it interests me, and probably more than a few of us on this site.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Bravo !
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
MailMonty wrote:
Bravo !
Are you a fellow engineer? We're rather rare here, you know...
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
hello
how i can use or call a sheet of excel from VC??????
|
|
|
|
|
Create ODBC connection into Settings/Control Panel /... ODBC and open this connection like database with SQL statements as Select , Create and ... .
Create is used to make a sheet into Excel !
That's is my experience
|
|
|
|
|
i heared that it have an activex componement called "Microsoft Office Spreadsheet 10.0" who can for that , but i don't how i can use it .
are there someone who can help me ?
|
|
|
|
|
Hey all,
I'm currently making my own ListCtrl derived from CListCtrl. Today I added the feature of adding a checkbox to one of the list control's items. Everything turned out nicely except for one little detail. Since I'm making the check box the same size as the item it's currently being attached to the size of the checbox control is bigger than the check field itself (making room for e.g. text) and the default background color of the check box is gray and my list control is white:
http://www.blacksmith-studios.dk/list_example.jpg
Is there any way to set the background of the check box to white without having to do some custom drawing (and thereby also creating a whole new class)??
Thanks in advance,
Soren
|
|
|
|
|
I tried to import a sound file from the insert menu and got these entries automatically in the .rc file:
IDR_WAVE1 WAVE DISCARDABLE "DOOR.WAV"
#endif // English (U.S.) resources
Heres how I use it:
case WM_COMMAND:
{
switch(wparam)
case ID_SMENU_PLAY_DOOR:
{
PlaySound(MAKEINTRESOURCE (IDR_WAVE1),NULL,SND_FILENAME | SND_ASYNC);
} break;
default: break;
}
but the compiler says:
error C2065: 'IDR_WAVE1' : undeclared identifier
Puzzled.
Thanks,
ns
|
|
|
|
|
Hi ns,
Have you added the #define for the IDR_WAVE1 to your resource.h file, or at least checked that it is there.
regards,
Dark Angel
|
|
|
|
|
I feel sheepish now.... . No .h file was generated automatically (the sample I have does it all by hand and I am sort doing both - automatic and self generated). Anyways the h file I that I currently include in the script is not automatically made and it just didnt occur to me that I was responsible for #defines ............. . SO is it true that when you make a new rc script and add resources to it, you have to make the .h file with the #defines yourself? Thats what it seems like....
Thanks very much.........with your help it works great!
ns
|
|
|
|
|
Hello,
I am receiving arguments from a command line. Some of these values need to be in the form of ULONG data type.
When I extract the args I am assigning them to CString data type.
Is there a way to convert CString to ULONG???
Thank you.
|
|
|
|
|
use the _tcstoul() function to convert your string to the unsigned long data type.
I Dream of Absolute Zero
|
|
|
|
|
I had no idea this was possible. How do you convert the CString "Yeah baby! Let's go swimming!" to an unsigned long integer?
Is it just the memory address of the CString object that is assigned to ULONG?
If so, why not just use (ULONG)&String?
|
|
|
|
|
Terry O`Nolley wrote:
If so, why not just use (ULONG)&String?
As you may have guessed, I meant converting a string representation of a numeric value to ULONG.
I didn't see your sarcasm tag there Terry
I Dream of Absolute Zero
|
|
|
|
|
debutante wrote:
Is there a way to convert CString to ULONG???
see response to Terry's post above ^^^
I Dream of Absolute Zero
|
|
|
|