|
Is your problem solving?
|
|
|
|
|
I am on holiday
|
|
|
|
|
|
See if this article is of any help.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Nice article!
The OPs problem I reproduced is, using MySQL, the 7th dialog in your article never comes up
when using the wizard to create the recordset class.
I wouldn't necessarily expect it to because I was under the impression that getting a list of
tables and views in a database is vendor specific. Am I wrong? Is there a standard SQL
statement to do that?
Thanks,
Mark
|
|
|
|
|
Mark Salsbery wrote: Am I wrong? Is there a standard SQL
statement to do that?
I don't know.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone
I m new to vc++. Now I m doing my undergraduate project in a wifi location system.
I want to track user's position on aGUI containing a map , but I have no idea about images and maps and how to import them and use them in VC++.
I hope someone will show me a webpage or book about this topic.
Thank U in advance.
|
|
|
|
|
What format are your maps, how many are there and how is the users position being represented?
|
|
|
|
|
The maps are JPEG or CAD but i may convert them if necessary.There are more than 4 maps , depending on where the user is the appropriate floor map will be loaded then user's location will be represented by a dot on the map that represents his actual position.
Thank U.
|
|
|
|
|
I don't know about CAD but OleLoadPicture is able to load a JPEG image into an IPicture instance. Search the article on CP to know how to load the picture. Once loaded you will have HBITMAP which is what most of the GDI functions use when drawing to the screen.
Create a window, or choose a RECT in your main window. Use GetDC() CreateCompatibleDC() SelectObject() and BitBlt(), or StretchBlt(), to draw the picture to the screen. Then draw your dot on top of this image using SetPixel() for a single dot, or Ellipse() if you want something a little bigger.
|
|
|
|
|
|
Thanx , i ll try.
Much Appreciated.
|
|
|
|
|
You're welcome
|
|
|
|
|
sameer22 wrote: I want to track user's position on aGUI containing a map , but I have no idea about images and maps and how to import them and use them in VC++.
I hope someone will show me a webpage or book about this topic.
try google api.. search google for same!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I'm having problems using the following MicroSoft example.
http://support.microsoft.com/kb/178749[^]
When I get to step 6. "Add an include directive for each header file..."
If I try to complile I get 187 errors. Here's the 1st one.
Error 1 error C2371: 'FontPtr' : redefinition; different basic types c:\documents and settings\dan\my documents\visual studio 2005\projects\auotexcel\auotexcel\debug\excel9.tlh 982
I'm running Visual Studio 2005, Microsoft Excel 11.0 Type Library, Windows 2003 Server.
Thanks for any help.
Dan
|
|
|
|
|
Hi! I`m creating a dialog based application with one main dialog containing TabCtrl each of tabs in TabCtrl contain individual dialog. This application will be used for ticket printing in a museum and each tab is for different ticket type, where you will only need to enter the count of visitors. The ticket prices are held in a database. To avoid the need to access database each time the price of a ticket needs to be read, I want to create a global Struct variable, then on applications InitInstance() read the values in to that variable.
Example:
Struct prices<br />
{<br />
double price1;<br />
double price2;<br />
double price3;<br />
double price4;<br />
};<br />
I tried defining the struct in applications header file, then after class definition in same header I added line:
extern CMyApp::prices price;
Later in applications InitInstance() I call:
CMyApp::prices price;
That way I`m able to access price.price1, price.price2.. etc. in any class.
Iv`e heard about creating seperate class for global variables and then access them like CMyGlobals::Variable...
What is the best way of creating global variables? And what is your opinion of my solution.
Thanx!
-- modified at 11:10 Sunday 4th February, 2007
|
|
|
|
|
Using global variables is often very undesirable in C++. I recommend, instead of creating a global struct, create a singleton class.
class Prices {<br />
private:<br />
Prices();<br />
~Prices();<br />
public:<br />
static Prices* CreateInstance(){<br />
static Prices;<br />
return &Prices;<br />
}<br />
}
Then, anytime you want to get your prices, just call Prices::CreateInstance().
You could even create the class in such a way that it must be initialized with the ticket prices before CreateInstance will return a pointer.
|
|
|
|
|
much better would you create singleton class use it through out the project!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I have a property sheet in a CFormView. The property pages dont
seem to be created until I visit the specific View, so I do not
want to transfer data from a CPtrArray to display in the property
page until the property page is created.
What function can I use in my View or property pages to transfer data
from a CPtrArray to actually display in the property page? I cant use
OnUpdate. If I do, this is called before I visit the property page and before its Window is created. I have not had any luck with OnActiveView in the CFormView (which would then load data from the property pages).
I tried OnSetFocus and that really throws the whole program off; I cant
type data in edit boxes or doing other really small things. I tried
OnInitialUpdate as well.
Im trying to find a function to call in my CFormView class or in the
property pages that will then let me display data on the property
page.
Please, please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
In the property pages:
OnInitDialog() is first chance you get to access the page's dialog with a valid HWND.
Just like any dialog, it's a great place to initialize/populate controls.
OnOk() is the last chance.
OnKillActive() gives you a chance to validate user input before allowing the user to switch pages
or leave the sheet.
|
|
|
|
|
I have developed an application that grabs frames from a webcam, but i now need to compare these frames for motion(differences). I have had a look around and the only method i found was to compare each pixel in each frame but the speed of this is far to slow to be pratical.
Can any help me out?
|
|
|
|
|
You don't need to compare each pixel.
Depending on the size of the images ( lets say 640, 480 for example ), build an array of points each indexing a point in the image ( every 50 pixels maybe ). Then in your loop, only call GetPixel() for those points. If 30% of them changed since the last time, you have detected movement.
|
|
|
|
|
True this does speed up my program but i need to pinpoint the motion and highlight it.
|
|
|
|
|
Ok, so im running MS Visual C++ 6.0, programming a C++ MFC program.
Im my dialog i have a edit box (locked to numbers) were the user will type in a float (a price)
So then i have to use GetDlgItemText go get the float into a CString (cant use getdlgitemint as it looses the decimals)
but now i then need to convert the cstring (containing someting like 29.88) into a normal float, like this:
Main->Price=cstringprice;
ive tried loads of things, like atof.. but all of them make errors when trying to use the variable it set
so got any better ideas of getting a float from the dialog into a float? or converting what GetDlgItemText brings into a float?
thanks!
/Johannes
|
|
|
|
|
atof() should work just fine. Perhaps you could show the code for your converting and we may be able to point out the error.
|
|
|
|