|
This article does'nt write on subject I am interested in, as such it did'nt helped me at all.
Instead, I am (as I wrote above) intereseted in "procedure" in "completing" screen saver in Visual C++ environment.
Thanks.
|
|
|
|
|
Just got Visual C++ .NET and am having a problem that I can't figure out. I am trying to use the CRecordset::GetFieldValue function. .NET is giving me errors telling me that it can't convert from a CString to a CDBVariant.
I'm using it like this:
recordset.GetFieldValue("Field", TestString);
This works fine in VC++ 6.0, but now it doesn't work in .NET?? Am I doing something wrong? I selected to create a regular dll file, but everywhere that I call this it tells me the same error.
|
|
|
|
|
Hello everyone,
This is kind of a LAZY question but I will ask it anyway..
Does anyone have a good way of calculating file transfer rates? I have an application where I transfer files.. On my status bar I have a pane for the progress bar, transfer rate and the name of the file being transferred..
In the transfer rate I have
int nSpeed = 0;
CString strRate;
strRate.Format("%dKb of %dKb - %dKbps",wParam/1000, m_dwFileLength/1000, nSpeed);
This works fine minus the speed of course
I would like to show the speed.. (nSpeed)
What would be my best bet for calculating the speed?
Thanks,
Rob
|
|
|
|
|
Never mind I figured it out...
|
|
|
|
|
Hi,
Im trying to use STL in my MFC program in VC++. It keeps on giving me errors.
Im sure there is a simple way to fix it, but i have no idea what that way is. Can someone help?
Cheers
Dor
|
|
|
|
|
Well, unless you give us some details of the problem, you might be better off trying here[^]...
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Taka Muraoka wrote:
you might be better off trying here[^]...
LOL
Yeah please post the error you are getting..
|
|
|
|
|
Well, i include all the right things and it gives me this error on the line that i declare the list object on:
c:\program files\microsoft visual studio\vc98\include\ios.h(146) : error C2872: 'streambuf' : ambiguous symbol
I know that the code works when its not using MFC, this error only comes up when in an MFC project
Cheers
Dor
|
|
|
|
|
This is almost certainly caused by your having #include'd mismatching files. Most STL objects come in two versions, one that lives in the global namespace (this is the old style) that you get by #include'ing <iostream.h> The newer version lives in the std namespace - you this by #include'ing <iostream> (nb: no ".h")
So if you #include *both* files and have a using namespace std directive somewhere, when the compiler finds a reference to an STL class, streambuf in your case, it has two matching possibilities i.e. ::streambuf and std::streambuf and doesn't know which one to use.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
But the #include <list> only appears once in the project.
should i be using using namespace std; with this version, and should it appear in the header file of the class, and should it be global or local to the class?
sorry, im bombarding you with questions!
Cheers
Dor
|
|
|
|
|
You need to be careful when typing in #include statements here. the < looks like the start of an HTML tag and doesn't get processed properly - use <
Never put "using namespace std" in a header file - it should always go in the .cpp file, *after* all your #include's. It is not something that is global/local to a class but instead something that relates to an entire file, during the compilation process.
This kind of thing is almost impossible to track down without having access to a full copy of the source. The reason why it is working previously but not with MFC is that MFC is #include'ing its own version of the STL headers, probably the old .h ones while your code is #include'ing the new ones. I would try fiddling around with your #include's. You might want to turn off pre-compiled headers while you're doing this since it will almost certainly cause you grief
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Cool, Thanks heaps for you help
Dor
|
|
|
|
|
Now I using OLE to implement drag&drop. the OLE does not do more thing about image show unless a simple state cursor, I would like listen your think about maintain a image show between drop source AND drop target when user draging.
Thanks
|
|
|
|
|
You could manage yourself the drawing of the image when mouse moves if drag&drop occurs in the same application, and after having determinate the image to draw when dragging begins.
One small village of indomitable geeks still holds out against the invaders. And life is not easy for the managers legionaries who garrison the fortified camps of Microsoftum, Javum, Ceplumplum and Vebasum
|
|
|
|
|
Hi.
I want to display YV12 format frames by building a FilterGraph in DirectShow. Those frames are captured from a file. So, I create a source filter inherited from CSource and a output pin inherited from CDynamicOutputPin. Then, I connect this source filter with the Video Renderer filter which is supported by DirectX 8.0 (The CLSID of that filter is CLSID_VideoRenderer).
In DirectX 8.0 SDK, it emphasizes that the Video Renderer, when it is initially connected to the upstream filter, will always insist on a RGB format, so I should let the Video Renderer negotiate a dynamic format change to the appropriate YUV color space after the graph goes into a run state.
But, it only works in the RGB exchange (ex: RGB32 to RGB24). If I attempt to change the output formats into YV12, the return value of the function IPinConnection::DynamicQueryAccept running in CDynamicOutputPin::ChangeMediaType fails. Why??
I think that it could be the argument's problem. Before the output pin of my source filter calls the ChangeMediaType function, we should prepare a CMediaType argument for it. The CMediaType argument is filled with the new media type we want.
The following is my settings of the CMediaType:
majortype = MEDIATYPE_Video;
subtype = MEDIASUBTYPE_YV12;
formattype = FORMAT_VideoInfo;
pbFormat = (BYTE *)pVideoInfo;
cbFormat = sizeof(VIDEOINFOHEADER);
How to setting up the data of VIDEOINFOHEADER will be fine for YV12 type??
And, the format type (FORMAT_VideoInfo) is correct??
Thanks.
Bert Chen
|
|
|
|
|
Hi everyone
I'm developing an application, and in that application i added a dialog on his right, this dialog have a tab control on it. The problem is that i can not see the tabs on the dialog when i add more tabs, only appear the tab control with no tabs.
thanks
|
|
|
|
|
Hi there,
When ever ive used tab control, ive used something similar to the following code:
CTabCtrl m_MainTabCtrl;<br />
TC_ITEM TabCtrlItem;<br />
TabCtrlItem.mask = TCIF_TEXT;<br />
TabCtrlItem.pszText = "Tab1";<br />
m_MainTabCtrl.InsertItem( FILE_RESULTS_VIEW, &TabCtrlItem );<br />
TabCtrlItem.pszText = "Tab2";<br />
m_MainTabCtrl.InsertItem(FILE_SCAN_VIEW , &TabCtrlItem);
This will show the Tabs only, I then insert a CDialog and show and hide the dialog as needed by the tabs. Hope this helps.
|
|
|
|
|
Hi´
Look all the above code i've done it before i post my message, but it just doesn't work. when i try to put a tab in a dialog app it work. An example of my app is the msdn , with a tab in the left.
|
|
|
|
|
All i know is that i created a dialog box, then put a tab control in that. You have to make sure that you create and show the dialog that holds the tab. I don't know what else to say sorry. The only way i can help you further is to see your code.
Dor
|
|
|
|
|
Use the CTabCtrl::InsertItem to create the tabs...
regards
M$
|
|
|
|
|
fwrite, fread and friends are easily many times faster than WriteFile, ReadFile and friends, when doing lots of small reads and writes. this means my program is many times slower than it used to be.
are there any ways to improve the performance of the Win32 I/O operations when doing lots of little reads/writes? (no, rewriting the code that does these reads/writes is not an option (LibTiff, LibPNG, JpegLib, etc).
fyi, here's my open-for-read:
fileHandle = CreateFile(pFileName, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-c
I'm not the droid you're looking for.
|
|
|
|
|
I'm a bit surprised you are seeing a big difference. Are you opening and closing the file each time? If so that would have a big hit. What about doing a big dummy read to get the entire file cached.
If you *could* rewrite the code then I'd suggest trying memory mapped files.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Neville Franks wrote:
I'm a bit surprised you are seeing a big difference
in some cases, the difference is over 12x. CreateFile etc is essentially unusable, but it has the feature that you can pass a HANDLE out of a DLL, while you can't pass a FILE* out.
Neville Franks wrote:
Are you opening and closing the file each time?
no. it just the fact that i'm lots of little reads/writes (parsing images, etc).
-c
I'm not the droid you're looking for.
|
|
|
|
|
Chris Losinger wrote:
while you can't pass a FILE* out.
why not?
So the DLL code isn't yours and thus can't be changed or it is yours and you don't want to change it because ...
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Neville Franks wrote:
why not?
because the DLL and the EXE will be using different copies of the CRT.
-c
I'm not the droid you're looking for.
|
|
|
|