|
I hope you are using Visual Studio with CLR support. You can create a managed C++ project by File -> New Project > CLR -> <lot of="" managed="" templates=""> I referred Visual Studio 2008 and the sequence can vary depends on the version you are using.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Good Morning All
I am currently working on a project involving an ultrasound machine.
The ultrasound machine puts out audio and a PC is supposed to receive it through the line in port. I was wondering if any of you kind users could point me in the right direction to receive this data with C++.
I have of course done some searching but the words "line" and "c++" are causing my search results to be horribly inaccurate.
Thank you in advance
Shane
|
|
|
|
|
Maybe try looking into using DirectShow, at the first look it might seem complicated but if you get to know it's not that hard. True, i didn't use it for capturing audio yet though.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
DirectSound has audio capture capabilities[^]. That page also mentions waveInOpen[^], which looks like it does audio capture.
The main trick then is identifying how to specify the line-in port!
|
|
|
|
|
Hello,
I've got a few projects I'm attempting to cleanup. They are all in VSS and in the parent directory for a few projects reside a file with the '.vssscc' extension.
Should they be removed? I thought they were a local repository for what files have been added to VSS. Doing some reading I understand that the information contained in the files is supposed to represent which files to exclude from the project's source tree in VSS.
Upon inspection in find:
""<br />
{<br />
"FILE_VERSION" = "9237"<br />
"ENLISTMENT_CHOICE" = "NEVER"<br />
"PROJECT_FILE_RELATIVE_PATH" = ""<br />
"NUMBER_OF_EXCLUDED_FILES" = "0"<br />
"ORIGINAL_PROJECT_FILE_PATH" = ""<br />
"NUMBER_OF_NESTED_PROJECTS" = "0"<br />
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"<br />
}<br />
which seems to contradict file exclusion.
Is it safe to remove these files from source control?
|
|
|
|
|
Hi~I am working a window form , with a picture box,label and numericUpDown
the picture box's image is like a compass ,when I change the value in numericUpDown->value, it is from 180 to -180, left is +ve and right side is -ve.
The label will show the corresponding value like north,N30E....
but when I work in the from 90 to 180,
what I decide is an eqatuion like numericUpDown->value - 2*n,where n is from 1 to 89.
There is no problem when I increase it from 91 to 179,it will shw the correct value from N89E to N1E, but when from 179 to 91,there will be problem. Moreover, if the numericUpDown->value is just change up and down, bb will also accumulate..so the value display in the label will be wrong...I really don't know how to write...
if(numericUpDown2->Value > 90 && numericUpDown2->Value < 180)
{ //a= numericUpDown2->Value;
cc = Convert::ToDouble(numericUpDown2->Value);
cc=cc-(2*bb);
aa=Convert::ToString(cc);
if(bb<89)
{bb=bb+1;}
else
{bb=1;}
label12->Text="N"+aa+"E";
}
|
|
|
|
|
OK, I am very confused by this. You seem to have 3 things going on, and I'm not sure where the problem actually is. It doesn't help that your code is looking very un-MCF/C++ like. Maybe you should be in the Managed C++/CLI forum?
1/ You have an Up-Down control (which I think of as a spinner, but you're actually correct). I'm confused what you're setting the range to. I think it's from -180 to +180
2/ You handle either the WM_NOTIFY/UDN_DELTAPOS or WM_HSCROLL/WM_VSCROLL messages sent from the up/down control. Do you get the correct values?
3/ Then you have to translate the -180 to +180 bearing value into a nice text representation. You can probably be hyper clever, but I'd suggest you do something like:
if (bearing >= 0 && bearing <= 45)
{
} else if (bearing >= 45 && bearing <= 90)
...
As I suspect you're posting in the wrong forum, I'll stop now. But the idea is to just break your problem down into ever smaller bits, and see where you fail.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
I need to display ~ 100000 entries in a windows list which are stored in an SQL database (queried by a SELECT query with a few JOINs).
1st question: In only need to display a simple list. I would really like to use a Listbox Control for the sake of simplicity. Do I really need to choose a (complex) List Control?
2nd question: I tried a virtual list with a simple SQL query:
OnInitDialog()
...
m_ctrlWords.SetItemCountEx(count);
....
OnLvnGetdispinfoWords(...)
...
sql.Format("SELECT keywordID, keyword FROM keywords ORDER BY keyword LIMIT %d, 1", index);
const char *res = query.getStringField("keyword");
lstrcpy(pItem->pszText, res);
but this is really too slow.
I think I need OnLvnOdcachehintWords but it's somehow complicated. I could not find any concepts (which data structure to choose??) or examples concerning this
The problem is that I have to remove old entried in cache (or my app's memory consumption would explode).
Does anyone have implemented such a virtual list (with data in SQL) already?
Are there some examples or concepts available?
Thank you very much,
Niki
|
|
|
|
|
You'll probably be better off executing something like "SELECT keywordID, keyword FROM keywords ORDER BY keyword" within OnInitDialog and caching the results in a resultset or whatever equivalent your database interface technology offers. Then you can interrogate the cache within OnLvnGetdispinfoWords and don't need to bother with OnLvnOdcachehintWords .
|
|
|
|
|
Hello,
I have to correct: The entries are much more than 100000...it's a fulltext recherche of a huge database system.
So it's definitifely too large to just read out all entries and cache them.
Regards,
Niki
|
|
|
|
|
I have tried it using caching and virtual list controls. Even if I read only the elements from LVN_ODCACHEHINT and cache them into a map, the list is really, really tooo slow.
What could be the solution? I just want to have the same as WinHelp32's keyword (or topic) search. For some reason, this list is very very fast since over 10 years (with slow computers).
Regards,
Niki
|
|
|
|
|
nobaq wrote: I have tried it using caching and virtual list controls. Even if I read only the elements from LVN_ODCACHEHINT and cache them into a map, the list is really, really tooo slow.
I'm surprised - I've implemented virtual lists that provide views over 10s of thousands of rows (and 10s of columns) of data - they've been as quick as you could want.
I feel sure you're using the right technology (virtual list controls) but there's something not quite right about your implementation?
|
|
|
|
|
One other thing - have you profiled the code to see what is slowing it down?
I'd suggest implementing a virtual list control that just displays the numeric index of the list rows, to convince yourself that you've got the virtual list control set up correctly. Then work out how much of the SQL query you can do without taking too much time, and you can try to merge that into the list control implementation?
|
|
|
|
|
OK - in that case, you want to cache maybe a couple of hundred rows starting at the row that's at the top of the list control. Then, as users move down the list, you can retrieve a few hundred rows at intervals, when required?
|
|
|
|
|
nobaq wrote: I need to display ~ 100000 entries in a windows list...
Why? Who would want to navigate through such a list?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Just look at winhelp32 fulltext- or keyword search.
This is exactly what I want to implement.
Regards,
Niki
|
|
|
|
|
Use a CListBox,in virtual mode.
If I remember correctly, You will need to manually draw and manage the data, but it will make the CListBox
very fast; once you know how to do it, you will use it everywhere.
You will need to override the CListBox::DrawItem (and maybe the CListBox::MeasureItem )
|
|
|
|
|
Hi, thank you for this hint.
I've been searching for a while now but I can not find any docs
Do you have a reference, docs, howtos for subclassing CListBox in order to implement a virtual listbox?
Any anyway, how do I query data from my database when "scrolling" very fast? I think i need to minimze my database queries but on the other hand I need to display something while scrolling...
Regards,
Niki
|
|
|
|
|
Hi
I've searched documentation and I can't find any answer to my problem.
I'm trying to burn an iso image. I call SHCreateStreamOnFileEx to get a stream from file and pass the stream to DiscFormat2Data->Write.
It all works fine but is there any way to set the name of CD ?
Currently when I'm opening an iso file, for example "NAME_DIGITS_MORE_DIGITS.iso"
my CD is called "NAME". I would like the disc to have the same name as the image.
I saw the function put_VolumeName but I can only use it when I'm creating an image myself.
The iso I'm trying to burn are made by other application
Can someone help me?
|
|
|
|
|
In which case CWnd::SubclassWindow(HWND DocumentList) fails, I have locally declared and initialized DocumentList which is used as the the parameter?
Software Developer
Sanjay Khapre
modified on Wednesday, January 7, 2009 10:03 AM
|
|
|
|
|
It can fail if it gets a non-valid HWND as parameter (like for example NULL) or if it gets a window that already has something attached to it (instance of another CWnd derived class). These are what i can think of now. But place a breakpoint, and step into that method and just trace down where it fails.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I have inherited some old code. Our sadistic project management has decided to forbid use of MFC in the hope of being more portable. I replaced all the CStrings with string, now I have got some tricky parts left.
The guy who wrote this used CMapStringToOb in what seems to be a very clever way and I think it is a fine piece of code. But I have to replace it - but with what? I can't use CObjects any more.
I have things like this:
CString csMsgID;
pCommand SACommand; //(which is a CObject)
CMapStringToOb m_knownCommands;
m_knownCommands.Lookup((LPCTSTR)csMsgID, (CObject*&) pCommand)
m_knownCommands.SetAt((LPCTSTR)csMsgID, apFba[i]);
I suppose I could plod through and dream up something complicated and slow, but does anyone have an idea how to do this in an elegant manner? Is this what the type Object is for?
-------------
Bibo ergo sum
|
|
|
|
|
RedSonja wrote: I have inherited some old code. Our sadistic project management has decided to forbid use of MFC in the hope of being more portable.
I'm definitely not an MFC fan, anyway I think your management deserves a kick in the ass.
Must you be stuck with C language or may you use C++ ?
With C++ , you may use STL containers. If you need to use only C , then I suppose you should search for a library offering hashing functions.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Oh, yes, we can use STL containers. Which do you recommend?
(I am not really lazy, but I do not usually program this high up in the food chain, and my boss wanted it done in December.)
-------------
Bibo ergo sum
|
|
|
|
|
I guess using a std::map would do the trick. The problem is that you won't be able to use CObject as a base class, but anyway it is quite ugly anyway. If all the objects in your map have the same base class, then it is fine. If your map needs to store different kind of objects, then probably you need to think the design a bit better...
|
|
|
|