|
I was wondering how to create a simple grid, using the win32 api only.
Dont want to use MFC or something like that. I cant find any predefined
control classes like BUTTON, EDIT and so on to pass in to CreateWindow()..
So howto do it?
|
|
|
|
|
There is no grid control provided with VC except as an OCX. You'll need to create a window, draw it yourself and respond to messages yourself. Chris has done an excellent job of doing this with MFC, and others have ported it to WTL, all available on the site.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Oh.. Well, I started to expect that. I'm used to c++ builder, were you got a grid control just a mouseclick away, now I'm going to port a project to windows ce, cant use builder then... The MFC grid by Chris looks great, but a bit to complex for my needs... Not sure it would run on ce without some changes.
I'm leaning towards just stacking some edit controls together and doing some functions to achieve grid type functionality.
|
|
|
|
|
I think that the grid control has already been converted to run on CE.
Michael
|
|
|
|
|
Hi !!
I have this DLL in which i the global system hook procedure. also there is an installing and an uninstalling function which i have exported and use it in a separate EXE. i am not going in for shared data segments coz only my process is gonna use this hook.
now i have declared a global flag in the DLL which i want the hook to set upon invocation. now the hook is invoked but it does not set the flag !!
i saw a number of examples on hooks but all examples use PostMessage(). the thing is that i don't want to communicate with the server. i just want to set a global variable in the DLL using the hook, so PM() doesn't make sense.
could you plz suggest something??? i am in dire straits
regards,
Faiz.
|
|
|
|
|
Use #pragma data_seg. More details in MSDN and in KB article Q125677.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Do functions in CSocket class throw exceptions?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Yes, at least searching through MFC source shows an AfxThrowResourceException() in CSocket::PumpMessages(), and other AfxThrow*()s in CAsyncSocket and CSocketFile code.
|
|
|
|
|
Thanks a lot
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Can anyone tell meho w to put a conversion constructor in this and implement it?
Matt
#include <iostream.h>
#include <string.h>
#define maxString 32000
class myString
{
int length;
char *stringData;
public:
myString();
myString(myString &);
int lengthof();
void show();
void getString();
};
myString::myString() // default constructor
{
length = 0;
stringData = new char[1];
}
myString::myString(myString &) //copy constructor
{}
void myString::getString()
{
char *firstString = new char[maxString];
cout << "Enter String: ";
cin.getline(firstString,maxString);
length = strlen(firstString);
stringData = new char[length];
for (int I=0;I
|
|
|
|
|
Not sure what you mean by a "conversion constructor". If you mean a copy constructor, then the prototype needs to be myString::myString( const myString& ) Note the parameter is a constant reference, your current code is missing the const.
--Mike--
http://home.inreach.com/mdunn/
your with and
|
|
|
|
|
Well, I was trying to display the date/time stamp (last modified) of a file using the following:
FILETIME ftTmp;
SYSTEMTIME stTmp;
GetFileTime( hFile, NULL, NULL, &ftTmp );
FileTimeToSystemTime( &ftTmp, &stTmp );
And I have noticed that the time I have derived was always 8 hours late. This is true to all the files I tried to read the info from. Am I doing something wrong here? Are there initializations needed? Is this a problem of MFC?
Any help/comment would be appreciated. Thanx!!!
Ryan V. - ryan@mobiling.nec.co.jp
----------------------------------
Discovery consists of looking at
the same thing as everyone else
and thinking something different.
----------------------------------
|
|
|
|
|
I was still looking around to solve my particular problem and I came across this function: FileTimeToLocalFileTime()
And added this to my code:
FILETIME ftTmp, ftLocal;
SYSTEMTIME stTmp;
GetFileTime( hFile, NULL, NULL, &ftTmp );
FileTimeToLocalFileTime( &ftTmp, &ftLocal );
FileTimeToSystemTime( &ftTmp, &stTmp );
This seems to solve my problem. The time returned by GetFileTime was UTC based and I still have to convert it to local time. This would account for the 8 hours discrepancy 'coz my current location is GMT+08:00.
Hehehe... I solved my own problem.
Ryan V. - ryan@mobiling.nec.co.jp
----------------------------------
Discovery consists of looking at
the same thing as everyone else
and thinking something different.
----------------------------------
|
|
|
|
|
http://www.codeproject.com/dialog/stackdialog.asp
A great example with exactley what I need in my program. One problem....how do I derive my dialogs to TStacked Dialog thingy?
Argh if someone can explain this to me and how to get this working in my app, please Id appreiciate it very very much!
Thanks
Ashley 'Ashman' Rowe
www.settlers.net
|
|
|
|
|
I'm not quiet sure what your problem is. Have you looked at the demo project with the article.
Create your dialog resource as normal, create a class for CDialog and then edit the code and replace CDialog with TStackedDialog and make the other changes the article describes.
hope this helps,
Michael
|
|
|
|
|
Thanks man! I will try that....Sounds so easy here I am thinkin there is an option to derive from a class LOL!!
Thanks again
Ashman
www.settlers.net
|
|
|
|
|
Hi,
It seems quite complicated to use tab controls. I tried many times to get it work, but without success...
Could someone briefly explain me how to get things working? What are the different steps?
Thanks very much for your help
|
|
|
|
|
I am in c++ class in 9th grade and I need to make a win32 concole app, that has 6 options 1 generates a random nubmer another tellis if it is greater then 25 and less then 100, the other function is it generates a random number and the other let's me enter as many number's as a like intell I enter zero and avearages those numbers not including 0, then whatever I chose to make as a function, then a quit option!!!!!!!! PLEASE HELP I HAVE NO IDEAD CAN SOMEONE please help me make a menu ETC Give me any ideas.
|
|
|
|
|
Do you have any books to help you, like textbooks ? This is a *very* basic question, do you have any ideas at all ? You really should start by writing some code and posting it so that we can provide some help for you to learn, as opposed to writing a very basic C++ program that you can hand in, and you'll be back here when your next assignment is due.
Clue 1: Look up cin and cout.
Clue 2: Look up switch or if/else ( which is how switch is implimented )
Clue 3: Look up rand/srand
That's all you need actually. Feel free to post your code, or snippets of it you have trouble with, and both myself and others will be glad to point you in the right direction.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hello,
I have a dialog type app and I have 2 timers on the app, one timer displays the current time, and the other is a count down timer.. The problem I am having is that the count down timer is not very accurate.. it looses a few seconds every 10 minutes.. Is there another function other than OnTimer() that I can use that is exact? If so can someone provide me with a little code so I have a idea on how to use it..
Here is a small sample of the OnTimer function I am using.. I doubt there is anything wrong with it...
void CTimerDlg::OnTimer(UINT nIDEvent)
{
switch (nIDEvent)
{
case IDC_STATIC_TIMER1:
m_timer1.DisplayCurrentTime();
break;
case IDC_STATIC_TIMER2:
iS --;
m_timer2.Display(iS,iM,iH,iD,(CString)m_strTimer2="%D:%H:%M:%S");
break;
}
CBitmapDialog::OnTimer(nIDEvent);
Thanks,
Rob
|
|
|
|
|
I don't know about its accuracy... but you may use GetTickCount().
Take the initial value, then use subsequent calls to have a relative time (in milliseconds).
Otherwise use the same method with CTime::GetCurrentTime() and CTimeSpan.
HTH,
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
OnTimer is not very accurate. If you want higher precision, use the multimedia timer (look at the MSDN for details). Actually, the best timer I know of is the queue timer, but this one works only with Win2k and up.
I vote pro drink
|
|
|
|
|
Thank you both for your postings.. I have looked up Multimedia Timer at MSDN and it looks like is the way to go.. I'm pretty new at programing, do you have any small samples of how to implement the code? If not, no big deal, I'll try to plug away at the examples Microsoft gives (some of the stuff looks greek to me)
Thanks again for your input!
Rob
|
|
|
|
|
If I have a video clip of unknown length (file size) and in either AVI, MP3, or some other format, what would be the best way to display and control these clips from a C++ application?
One idea I have is embedding an HTML control so that I can use a resident viewer (MS MediaPlayer, RealPlayer, QuickTime, ...) from an HTML control page. Does anyone know how to embed an HTML page into VC++ applications/dialogs? (If I go this route.)
Thanks.
Johnny
|
|
|
|
|
Directshow. If you #include <dshow.h> and link to Strmiids.lib Strmbasd.lib for debug and Strmiids.lib Strmbase.lib for release, you can play a video like this:
HRESULT hr;
IGraphBuilder *pGraph;
IMediaControl *pMediaControl;
IMediaEvent *pEvent;
IMediaSeeking * pSeek;
IVideoWindow * pWindow;
// Create the filter graph manager and query for interfaces.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
pGraph->QueryInterface(IID_IMediaSeeking, (void **)&pSeek);
pGraph->QueryInterface(IID_IVideoWindow, (void **)&pWindow);
pGraph->RenderFile((bstr_t)lpszMovie, NULL);
pMediaControl->Run();
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|