|
Are you linking with with netapi32.lib ?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
I would like to change my freeware-software (MFC) to shareware.
Is there any class/tool I can use to let a customer easy register a trial-version after approx. 15 days? How do I generate keys from an E-mail-address?
Thanks
Ola Carlsson
|
|
|
|
|
Ola wrote:
Is there any class/tool I can use to let a customer easy register a trial-version after approx. 15 days?
They do exist, but it's pretty easy to write your own. The way I did it once was to write the day the user had started using my app and the current date in the registry. The current date was used to see if the user had rolled their clock backwards ( by more than one hour, to account for possible daylight savings).
Then I rewrote the same info into a file called msxmtd.dll, or something similarlly official sounding, and put it in windows/system. Then if the user found my registry entries and hacked them, their trial was officially over.
Ola wrote:
How do I generate keys from an E-mail-address?
All sorts of encryption methods exist. Do a google search and I'm sure you'll find tons. Hint - every char has a numeric value.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Hi,
Does anyone now a function/class to check if an e-mail address is valid?
/Ola Carlsson
|
|
|
|
|
Apart from parsing it for form, I don't think that is remotely possible. If I give you cgraus@mydomain.com, how can you tell that mydomain.com knows what to do with this address, except by sending an email to it and seeing if it bounces back ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
except by sending an email to it and seeing if it bounces back ?
My domain has a catch all, so nothing bounces back, just forwards valid stuff and deletes junk after a while.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I think it's interesting that we often qu-ote each other in our sigs and attribute the qu-otes to "The Lounge". --- Daniel Fergusson, "The Lounge"
|
|
|
|
|
Check the return status from the POP3 protocol's USER command. A "+OK" should be returned for valid usernames. This should work even for forwarding POP mailboxes.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Does this mean it would be trivial to write a spam filter, simply by checking all incoming mail for a valid return address ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
It's pretty easy to write, but I doubt it would be efficient, since you'd have to try to establish a connection to the POP server for each unique domain.
Also, it could easily give you bogus results - for example if you received mail from a valid address user@attbi.com , the checker would return "false" since you won't be able to connect to attbi.com 's POP server from outside their domain.
Further, if your domain's POP server had a catch-all account, any username at that domain could be flagged as being valid.
Imho, there's no foolproof way to verify the validity of an email address.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
It's actually totally unworkable. You have no way of knowing what a remote domains POP server is. MX records only point to SMTP mail exchangers, and often these have nothing to do with pop.
Also, very often POP servers are behind firewalls.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Not all POP servers will let you connect from outside their domain!
In the US, ATTBI (previously MediaOne) is notorious for no longer allowing you to check your mail remotely thru a POP email client, unless you're logged into ATTBI. However, they do offer a crappy web interface into their email system, so you can get/send email from any browser.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Neither will Yahoo! starting with the 24th this month
Best regards,
Alexandru Savescu
|
|
|
|
|
Hello everyone,
I have a STL containers of pointers to objects, something like:
vector <cmyobject*> MyVector;
Suppose I want to erase an element at a specified iterator and I am not sure wheter I have to delete my object first like
delete *it;
MyVector.erase (it);
or just
MyVector.erase (it);
I suppose the first version is correct, but what confuses me is what the documentation says that erase(it) will call a destructor call.
Is this true with pointers to object as well?
Thank you very much!
Best regards,
Alexandru Savescu
|
|
|
|
|
Because it is a vector, calling erase is very expensive. If you're going to do this to a number of elements, use remove to partition them first, and if you do it a lot, consider std::list, or if you need faster lookup than std::list provides, try set.
If you have a container of pointers, then you need to delete the iterators contents first, otherwise the pointer will be deleted and not it's contents. If you have a container of objects, then the destructor is called, but calling a pointers destructor is not the same as calling the destructor of the object being pointed to. If it was, memory leaks would not be possible.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Thanks Chris for your quick answer. Now everything clear.
Actually I am not using a vector, I am using a multimap My question was about deleting the pointer so the vector was the first container that came to my mind.
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexandru Savescu wrote:
Thanks Chris for your quick answer. Now everything clear.
No worries. It seemed to me at first that a vector should clean up after pointers, but on reflection it's obviously not the case. I usually write a function object and use for_each to clean up my containers of pointers, so that I don't get memory leaks on shutdown, etc.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
My modeless dialog (the same one I was having trouble with before ) is created in it's parent (COleControl-derived) OnCreate handler:
m_msgDlg.Create(IDD_DIALOG_MSG, NULL);
When it is shown it is shown as follows:
m_msgDlg.SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
This appears at first to have the desired effect, because I now have a modeless dialog with it's own task on the taskbar.
Unfortunately, as always seems to be the way, all is not as it seems. If I left-click on it's task on the taskbar, which should minimise it, nothing happens
The dialog (which is completely custom drawn as a skinned dialog using BitBlt) handles minimising from a button click using the following code:
void CMsgDialog::OnButtonMinimise()
{
WINDOWPLACEMENT wndpl;
GetWindowPlacement(&wndpl);
wndpl.showCmd = SW_MINIMIZE;
SetWindowPlacement(&wndpl);
}
This does correctly minimise the dialog and clicking on it's minimised task in the taskbar does restore it.
Any ideas why this "standard" behaviour isn't working properly?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
The dialog does have the WS_MINIMIZEBOX style set?
Developers that like shiny objects also dig case mods and scratch-and-sniff stickers. Klaus Probst, The Lounge
|
|
|
|
|
It wasn't set. The dialog is skinned and doesn't have a title bar, which removes access to the Minimise Box style in the resource editor.
Thanks for pointing out the obvious
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Guys,
I need to read a few registry keys on a remote server (NT/win2k) but I'm not having any luck turning up ANY documentation. I know its possible because I see that in regedit you can connect to another computer and edit its registry. Could sombody give me a pointer to an API or something in MSDN or a webpage?
thanks
Al
|
|
|
|
|
You're probably looking for RegConnectRegistry()
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/regapi_803d.asp
Len
|
|
|
|
|
I have a dll which I wrote which is primarily called from C++ apps. Another group in our company wants to call the dll from VB 6.0. The function in question is coded as follows:
extern "C" __declspec(dllexport) bool _stdcall GetLoanAttributesXML(char* szxmlbuf, int nxmlbufLen)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//return GetLoanAttributesXML(szxmlbuf,nxmlbufLen);
bool bret = false;
CString csxml = theApp.Model->getLoanAttributes();
if (csxml.GetLength() < nxmlbufLen)
{
strncpy(szxmlbuf, csxml, nxmlbufLen);
bret = true;
}
return bret;
}
The function returns LoanAttributes in xml to the caller. This call works fine when called from C++ but I get an unhandled exception when it is called from VB.
Here is the VB declaration:
Private Declare Function GetLoanAttributesXML Lib "LoanUtil.dll" (szxmlbuf As String, ByVal nxmlbufLen As Long) As Boolean
Any assistance would be appreciated!!
mantrashrim
|
|
|
|
|
Strings in VB are actually BSTR in C++. So you need to declare your functions with BSTR instead of char* and it should work (if there are no other problems )
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I have two checkboxes. The second becomes enabled when the first is checked and disabled when the first is unchecked, but I also need the second to be unchecked automatically when the first is unchecked by the user.
The following code disables the second but doesn't clear it.
***********************************************************
void CTab3_SMS::OnSaveToPCcb()
{
//Get the current values from the screen
UpdateData(TRUE);
//Is the "FIRST" checkbox checked?
if (m_bSaveToPC == TRUE)
{
//Enable the "SECOND" checkbox
GetDlgItem(IDC_DELETEFROMSIMCB)->EnableWindow(TRUE);
}
else
{
//No; clear and disable the "SECOND" checkbox
GetDlgItem(IDC_DELETEFROMSIMCB)->EnableWindow(FALSE);
}
}
***********************************************************
What other command goes into the else{} statement?
Thanks, Aoife
|
|
|
|
|
CheckDlgButton (IDC_FOO, FALSE); /ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|