|
I would really suggest you read this entire tutorial:
http://winprog.org/tutorial/
But what you really need are these two pages:
http://winprog.org/tutorial/app_two.html
and
http://winprog.org/tutorial/app_three.html
wWw.KruncherInc.cOm
|
|
|
|
|
I would suggest looking at the articles at http://www.codeproject.com/editctrl/[^]
Start by hacking the windows edit control and getting a feel for how Windows implements an edit control.
Don't concern yourself with Open, Save, Save As commands as of yet...those are easy to add once you have an basic control built. Maybe not so much Copy, Paste, but i'd first get the caret moving about and inserting, deleteing characters down and bug free first.
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Has anyone used the MS ActiveX control - Record Navigation Control in an MFC app?
I like the look/functionality of the RecNavControl (like the record nav control in MS Access - VCR-type buttons), but I want to use this control not with an (imbedded) database, but just as a generic control.
I want to use this rec nav control to navigate a "linked-list" structure and display what current "link" i'm on, ability to jump to the "beginning of list", etc...
I'm having some problems with tying into the control as it just acts disabled and I can't do a "SetWindowText(szStr)" to fill the text window.
Any ideas? Any references out there? Thanks,
Johnny
|
|
|
|
|
Hi,
How would I supress a warning for a certain variable which I know is unused? On other compilers I can use something like #pragma unused (variableName).
Thanks
Hua-Ying
|
|
|
|
|
UNUSED(x);
UNUSED_ALWAYS(y);
UNREFERENCED_PARAMETER(z);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks!
UNREFERENCED_PARAMETER(z); worked for me.
Hua-Ying
|
|
|
|
|
Another approach is the following:
void function(type1 parm1,type2 )
{
} Commenting out the parameter name in the argument list guarentees that the parameter isn't used, since there is no longer a definition for it (the compiler will issue an error message otherwise).
Software Zen: delete this;
|
|
|
|
|
Hi,
Here is the scenerio.
sql server runs on computer myserver.
The application myapp (VC++ MFC) runs on another computer on LAN appComputer.
I need to restore the db mydb from myapp.
The back file is on appcomputer. So, when db tries to restore from thsi file it cannot access it cuz of security.
So i create a share in code myshare on teh folder containing the backupfile.
The Db still cannot access it.
But if I right click on teh folder and go to security taba nd add everyone to the list and provide full control to everyone it works fine.
Now am using sharing api fucntion netshareadd to add the share on the folder temporarily.
i went through the documentation of netshareadd but it does not provide any hints on how to add evryone to the security list in code.
sdoes anyone has idea how to do this??
thnaks in advance
|
|
|
|
|
Have you considered either the BACKUP DATABASE or SELECT INTO commands?
http://www.warriorforum.com/forum/topic.asp?TOPIC_ID=28236
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
well the database is already backup to a file. So backup datatbase is a no no.
Select Into returns one row of results, again unrelated to my problem.
What I want is to restore my database froma backup file on a remote machine on LAN.
This is doen by stored procedure using Restore Database blah from disk = path
now if path specifies a computer on LAn then it is like \\servername\drivename$\folder\file.dat
here SQL Server gives up since it does not have access to that drive.
So to provide access i create a temporary share on the said folder using sharing api function netshareadd.
It works fine but Server still cannot access cuz only certain people have rights.
So if i manually right click on the folder and go to security tab and add everyone to the list, SQL Server is happy, since it has access not.
The problem is how to do the same step in code.
Any suggestions???
|
|
|
|
|
So how about the RESTORE DATABASE command?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
That's exactly what doe snot work!
when a RESTORE DATABASE is given a path to file on remote computerr it fails because SQL Server does not have access to the folder!!!
|
|
|
|
|
Sorry, I did not see that (unhighlighted) command mentioned in your second post.
This sounds more like a SQL issue rather than a C++ issue. Do you agree? Have you consulted the microsoft.public.sqlserver.* newsgroups?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have.
CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID);
CBitmap bmp;
bmp.LoadBitmap(BITMAP_ID);
HBITMAP hBmp = HBITMAP(bmp);
pButton->SetBitmap(hBmp);
the bitmap doesnt appear any suggestions? What am i doing wrong???
Thanks in advance
|
|
|
|
|
Try this one.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thats a subclass and thats what i dont wanna do. I also tried adding the style BS_BITMAP thru the setwindowlong just to makesure the style was being set but no luck.....
|
|
|
|
|
Perhaps bmp is going out of scope and thereby causing badness? Also see my article, FooButton[^].
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
setbitmap takes an object so i dont think that could be a reason. But may be its worth trying.
|
|
|
|
|
sorry ravi, it was a scoping issue but i am still not clear why. the CBitmap bmp; is required to be a class level member. I was assuming that when we call a setbitmap on the button and pass a HBITMAP to it, a copy should be sent and there should be no scoping issue.
|
|
|
|
|
I'm fairly new to MFC and have been tasked with migrating an app from VC++ 6.0 to VC++ 7.0 (vs.net). For those who have done this before, are there any things I should watch out for or know beforehand ?
I was simply going to create a new solution in VS.NET, import my VS6.0 projects into it, and then fix each thing the compiler complains about. Is this the right way to go about it ?
thanks in advance
|
|
|
|
|
I don't think that there is a 'right' way to a v6 to v7 migration. Each project likely has it's own dependancies, libraries, etc. Having said that though, your stated approach would certainly be a good starting point. Although I'd be tempted to have VS7 even create all this stuff for you, by having it open the VS6 project files and see what it does.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
what I noticed when doing this (VC++6.0 -> 7.0 - 7.2, Studio.NET) was I got a lot of errors with STDIO (generally speaking, and specifically statements that std::ofstream and std::ifstream).
I had a lot of instances where it was ok in 6.0, but when I tried to use IO calls, it needed me to change things to pointers in 7.0 (addresses needed).
my 2 cents...
Johnny
|
|
|
|
|
dvolpe wrote:
was simply going to create a new solution in VS.NET, import my VS6.0 projects into it, and then fix each thing the compiler complains about. Is this the right way to go about it ?
You should be able to just open your existing .dsw in VS7 and it will create the solution for you.
File -> Open Project and then navigate to your .dsw. Maybe take a copy of the 6.0 project folder first before doing it.
I would imagine that you should at least run into some issues with stricter C++ language conformance. So you may have to do a few tweaks. I've not tried it but I can't imagine there will be any major problems.
Kevin
|
|
|
|
|
Hello,
how to install (use) Shockwave Flash ActiveX component and work with him in MS VC++ 6.0 project (fscommand, getVariable, setVariable)?
Thanks!
Serg
|
|
|
|
|
I want to attach a CEdit to A CView,how can i do that,thanks.
just now i've tried another method, i creat a CEditView and use CEditView::GetEditCtrl,which return a reference of CEdit&,but i cannot replace the Standard CEdit to the special CMyEdit derived from that.
help,either way is ok for me now,thanks....
Josephvan thanks for your attention
|
|
|
|