|
I have been working on this program for a while, just a simple Doc/View based database. I am new at programming and have learned A LOT while doing this but have come to the end of ideas on how to make my menu item ID_MENU_VIEW_CATALOG which is a dialog box, pop up when it is clicked. In fact, the item is disabled when I compile my program, even though I have the "Disabled FALSE" selected in the properties. Could someone please grant me some guidence and tell me what I need to do? I would really appreciate it.
Thanks,
Garry
|
|
|
|
|
I am not clear as to whether you want to instantiate a dialog box or to enable a menu item.
In terms of a menu item, make sure the follow options are set correctly in resource editor.
Enable - TRUE
Grayed - FALSE
Kuphryn
|
|
|
|
|
I'm sorry, I tend to go a little over board when explaining. I would like to instantiate a dialog box or to enable a menu item.
Thank you,
Garry
|
|
|
|
|
ummmmm to make a dialog appear from the menu click (and to make the menu not disabled automatically) make sure u have a message handler for the menu item in the app somewhere (usually the mainframe)
if u dont the menu is disabled and nada de nada happens when u click it
unless of course i got completely the wrong idea from the post
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hey all, I am hoping someone out there can help me.
I am sure this is a very beginner question, but then when it comes to databases, I am a very beginner. I am using MySQL with MyODBC. I have set up my CRecordView derived view (CFarmView ) and my CRecordSet derived recordset (CFarmSet ). When I view the records everything seems to work fine as I can step back and forth between records (using the first, previous, next, and last wizard supplied toolbar buttons).
Now I want to update a record, so I added a save button to my CFarmView with the following ON_BN_CLICKED handler :
void CFarmView::OnBnClickedSave()
{
m_pSet->Edit();
UpdateData(TRUE);
if (m_pSet->Update())
MessageBox ("Yes! :o)");
else
MessageBox ("No :o(");
}
When I execute the m_pSet->Update() line, I get a messagebox with the message "No cursor name available" and the output window shows the following TRACE output
No cursor name available
State:S1015,Native:0,Origin:[TCX][MyODBC]
Can anyone explain to me what this means, and how can I fix it?
ps. m_pSet->CanUpdate() returns TRUE so it is updateable.
pps. If it makes a difference, I am using VC7 on W2K.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I have this small program I want to sell as shareware and I was looking at ways to let the program expire after running x times.
I've read Nish's article[^], which I consider to be quite usefull.
That leaves another question:
How do you guys implement the license code part of shareware. Any good tips, articles on this.
I've looked at some shareware tools that automatically adds these things to your program, but I prefer to write my own code or use an opensource/freeware thing.
What do you use for encryption, generating the codes, etc...
I also saw a few e-commerce sites who offers automatic generation of license codes via a procedure which you supply.
This implies having a procedure that mangels a eg. company name/person's name to a valid key code.
I also see sites which can send out a predefined set of codes, probably based on a private key kind of thing, so without entering company information.
Is MD5 the way to go or do you use some other encryption techniques?
Thanks in advance,
Wim
|
|
|
|
|
Forget about licenses and stuff like that ... it doesn't really work, someone will always find a way, not to crack the license, but to go directly into the binary and find where the check function returns true or false and will add a JMP or something like that ...
If you want to distribute your application as a shareware, make the shareware a subset of the real full application or make the application save/render weird data. So the user will have fun with the shareware, and at some point will either buy it, or trash it. If she likes it, she will buy it ...
Max.
|
|
|
|
|
I urge you to reconsider the expiry concept. Instead, restrict the functionality of an unregistered version and/or use nag screens. I use this scheme in my products[^].
I often need more time to evaluate a program than 15 or 30 days, since I might not get time to try it for 10-20 days after installation. Imho, restricting the number of runs is equally bad.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
I had a look at your memwatcher product - which by the way looked great! - and I saw that you used a (company)name to register your product.
Do you mind to share how you implement this. Do you use a private key (internally in the program) together with a public key (companyname) to generate the registration code? Via what encryption protocol?
Or don't you use the name at all, as it is not really required at the registration site (else it should be required that the name entered at the site should match the one entered in the program).
That means you work with a set of predefined numbers which the site sends out?
I totally understand of course that you don't want to share this top secret information
I'm just interested.
thanks in advance,
Wim
|
|
|
|
|
Hi Wim, I'll respond offline.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Rule number one:
There's always a crack, that's how the light gets in
Rule number two:
Ur always a bpx away from finding that light
Forget about hiding code, just dont put it there
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
[ Crossposted in the XML forum]
My brief exposure to XML has been restricted to writing a compiler using SAX (in Java). I'm now back in C++/MFC land and need to populate a data structure with data read from an XML file, validated against a DTD. I also need to create an XML file, given a DTD.
Can you recommend a good "teach yourself DOM in 21 minutes" book or link? I'd especially like to know how to use DTDs to validate incoming data and write XML files.
Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hmm, MSDN's XML tutorial[^] seems like what I was looking for. Book and link recommendations are still welcome. Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Please check out
http://codeguru.earthweb.com/xml/XMLDOMFromVC.html
Very nice article .
PLus get the functionalities of the DOM Objects at W3schools.com
|
|
|
|
|
|
How can one determine if a root item is expanded?
|
|
|
|
|
You can use EnsureVisible(htItem) on one of the root's child items to see if it's showing, or use Expand(htItem, TVE_EXPAND) to expand the tree (if it's not already expanded).
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
|
|
|
|
|
BOOL bExpanded = (TVIS_EXPANDED & pTreeCtrl->GetItemState(hRoot, TVIS_EXPANDED));
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
|
Ok ok -- your way is better -- I just couldn't remember it...
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
|
|
|
|
|
It helps i had the code handy for other reasons.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
I'm currently working on a project that uses COM/ATL. I try as much as I can to stay away from MFC for:
1) I want to learn something else
2) Size of project
3) MFC dll redistribution problems (if there's any)
Should I be concerned about that or should I just link to the MFC library (static or dynamic?) and use it only when I need it? It's just that if you link MFC statically, the size of the DLL gets bigger and if you link dynamically, the user needs mfc42.dll...
Any hints?
Thanks!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Another problem with linking statically is that every app that uses a statically linked copy of MFC will have its own copy of MFC in memory, whereas if two or more apps both use the dll, only one copy of the dll needs to be loaded into memory
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
will have its own copy of MFC in memory
well, more accurately, it will have in-memory the parts that it uses, not all of MFC.
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
Static linking is the safest way to ensure that your executable will work regardless of what happens elsewhere in the system. It also makes for a smaller distributable (since you don't have to include the 1 meg+ MFC DLLs), and does not necessarily have a huge impact on exectuable size (since the linker is pretty good about thoring out unused code).
|
|
|
|