|
Must be something like this:
SYSTEMTIME st;
VariantTimeToSystemTime(v.date, &st);
TCHAR szDate[12];
wsprintf(szDate, _T("%02d/%02d/%d"), st.wMonth, st.wDay, st.wYear);
rechi
|
|
|
|
|
Thanks
I was Looking Exactly For The Same
Thanks Again
|
|
|
|
|
hi mates;
look at here at first :
//stripdec.h
#pragma once
#ifndef ipaddressing_strIPdec
#define ipaddressing_strIPdec
#include "stdafx.h"
using namespace std;
using std::string;
typedef unsigned long ulong;
// strIPDec in order to deploying A.B.C.D strandard IP address from plain
// string a.b.c.d
namespace stripdec
{
class StrIPGet
{
public :
StrIPGet();//constructor
string get();//getting input string a.b.c.d
void findindex();//finding index of each '.' in the string
void setseg();//now we have A.B.C.D which each segemnt is in digit form.
private:
string _inputstr;
short inpindex[3];
string segment[4];
};
class StrToDec
{
public:
ulong conv(string& _segstr);
};
}
//
#endif
////////////////
//stripdec.cpp
// strIPdec.cpp : Defines the entry point for the DLL application.
//
#include "stripdec.h"
#include "stdafx.h"
using namespace std;
using namespace stripdec;
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
//start
//------------------------------------------
string StrIPGet::get()
{
int count=0;
do
{
getline(cin,_inputstr,' ');
int j = _inputstr.find('.');
// While not at the end of the string:
while(j != _inputstr.npos)
{
count++
//find the next '.'
j = _inputstr.find('.', j);
}
if (count != 3)cout<<"invalid IP address ,try again."<<"\n";
}
while (count != 3)
//input is plain a.b.c.d along with error recovery.
}
//------------------------------------------
StrIPGet::StrIPGet()
{
inputstr.clear();//init...clearing an input string
}
//------------------------------------------
void StrIPGet::findindex()
{
for(j=0;j<=2;j++)
{
inpindex[j]=_inputstr.find('.',j);
}
}
//-------------------------------------------
void StrIPGet::setseg()
{
segment[0]=_inputstr.substr(0,inpindex[0]-0);
segment[1]=_inputstr.substr(inpindex[0],inpindex[1]-inpindex[0]);
segment[2]=_inputstr.substr(inpindex[1],inpindex[2]-inpindex[1]);
segment[3]=_inputstr.substr(inpindex[2],input.end-inpindex[2]);
}
//-------------------------------------------
ulong StrToDec::conv(string& _segstr)
{
return strtoul(_segstr);
}
errors :
/////////////////////
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(25): error C2065: '_inputstr' : undeclared identifier
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(26): error C2228: left of '.find' must have class/struct/union type
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(28): error C2228: left of '.npos' must have class/struct/union type
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(19): error C2653: 'StrIPGet' : is not a class or namespace name
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(5): error C2859: e:\codes\ip_addressing_solution\april11 ,2003\stripdec\debug\vc70.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(7): error C2871: 'stripdec' : a namespace with this name does not exist
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(28): fatal error C1903: unable to recover from previous error(s); stopping compilation
//////
so what is the problem here;
thank u for u'r comments;
bye;
|
|
|
|
|
Probably in strIPdec.cpp you should have
#include "stdafx.h"
#include "stripdec.h"
rechi
|
|
|
|
|
hey do anyone know how to sniff outgoing packets in a system, and do anyone have dnsapi.lib . if so i would be pleased
|
|
|
|
|
In Windows DDK , Packet32 driver is provided. using that you can catch all the outgoing and incomming packets. And you can also catch all the packets in the lan which r comming from/ going to other systems (if using HUB). have Fun......
|
|
|
|
|
what is windows DDK, tell me exactly how do i use packet32 in my vc programs, do u have any experience in using them please tell me yaar
|
|
|
|
|
the windows ddk is the device driver kit!
you have to order it at http://www.microsoft.com/ddk/ (its free i think).
i don't know the packet32 driver, but you will have to control it via DeviceIoControl, CreateFile, ReadFile, WriteFile like most other drivers.
|
|
|
|
|
I used the packet32 driver which is provided in Windows DDK 2 years back in my VC++ application for capturing packets in Win NT. Present situation i dont know, wether it is there in the latest version of DDK or not. check it out. If it is there inform me, i will tell you how to use it. It is very simple to use it.
|
|
|
|
|
hi,
i am getting COLORREF value.i want to get its equivalent color name..pls help me.
|
|
|
|
|
Anonymous wrote:
its equivalent color name
What do you mean exactely by "color name" ? Like in HTML ?
~RaGE();
|
|
|
|
|
Well .. COLORREF can handle 16 million colors i dont think that there are names for each one of them...
What you could do is to have a small array or string resource that you can map to the default colors (white, black,green,yellow,blue....) you know ..the basic ones.
|
|
|
|
|
Check out this article: http://www.codeproject.com/bitmap/ccolor.asp?target=ccolor[^] I've used this class before and whenever I need a color I just look up its name in the header file for this class. The article also has a display chart of all the colors it has pre-defined. Best of all the class is COLORREF compatible.
|
|
|
|
|
How to add Caption (Subtitle) to video in Win CE. Is there any filter is available for doing this. Please Help.
Thanking You
|
|
|
|
|
Gd day,
i want to like for example when this titleId 10 i selected, i dont know whether the popularity is updated or not. So this ID 10 has it own usagecount then it compare with usagecount of other titleID. Then the popularity will increase or remain same.
For That i had create the button "update popularity but how the function will be like--?? really thanks
|
|
|
|
|
Ohaiyo wrote:
titleId
What is that ?
Ohaiyo wrote:
the popularity
popularity of what ?
~RaGE();
|
|
|
|
|
This TitleID , Popularity are a set of IDs from my microsoft access database
Each set of IDs has it own usagecount and popularity.
For example, if the usagecount for this titleID 50 is 5, the old value of the popularity will be increment by 5.
Perhap how should i do this function.... /?? thanks much appreciated. i think this is rephrase better
The IDs are from the microsoft access database is link through ADO.
|
|
|
|
|
I am sorry Ohaiyo but I am having a hard time understanding what you're asking. No offense but my best guess is that you have field (TitleID) in your database and you have two more fields UsageCount and Popularity, perhaps on a different table, I really don't know because you haven't provided that kind of information.
First you have to go to the recordset that has the titleID that you are looking for. Perhaps by setting a filter or running a search.
To search you use:
public void find(String criteria, int SkipRecords, int searchDirection)
To filter you use:
public void setFilter(Object filter)
There could be other alternatives as well.
Once you have a pointer to the recordset you can update its fields by using:
_variant_t vField;
vField.SetString( (LPCTSTR) strField );
m_pRs->Update( vField, _variant_t( (long)lSomeData ) );
I hope that helps.
none
|
|
|
|
|
I'm trying to use the method GetSelItems from CListBox and I get a user error on a system that has an older vs of conctrl32.dll on it. What is the best way to update this dll to get this method to work properly when I install it on systems with the older dll?
|
|
|
|
|
How about just copy the newer version with your program?
I guess usually the program first look at its current folder for the files
before it looks for the window's folder.
I am not sure. But you can have a simple try of it.
|
|
|
|
|
comctrl32.dll gets loaded with the OS and you are unable to just copy over it with a newer vs. Anyone know how to overwrite a loaded system dll?
|
|
|
|
|
I am not sure, but you can prompt the user for overwriting, then overwrite it (there are articles on CP about how one can overwrite files being used), and then ask the user to restart.
~RaGE();
|
|
|
|
|
I added successfully 4 MFC projects in Property Sheet.
Thank you for kind help.
However, I faced another problem.
2 of 4 MFC projects have CFileDialog in them.
To open and save files from directory that I want,
my code have following lines.
CFileDialog fileDlg (TRUE, "exe", "*.exe",<br />
OFN_CREATEPROMPT | OFN_HIDEREADONLY, szFilters, this);<br />
<br />
if ( fileDlg.DoModal () == IDOK )<br />
{<br />
..............<br />
}
When I try to compile and run it, it doesn't work.
Property page was successfully opened, but click open or save button,
program stoped and any I had to kill the process.
Debug process shows if ( fileDlg.DoModal () == IDOK ) line has problem.
But, it was working as a independent project.
Please help me.
Can I have solve this problem?
Thanks in advance.
|
|
|
|
|
CString yop = "Executable (*.exe)|*.exe||";
CFileDialog FD(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,yop,NULL);
FD.DoModal();
m_Path=FD.GetPathName();
Check the two ||at the end of yop. these are the ones that screw up your CFileDialog.
~RaGE();
|
|
|
|
|
Hello,
My project (MSVC++6, SP5) is under MFC and I use templete such as
CMap, CList, CArray, etc.
I also want to use a class that is written under STL, using such as string, vector, etc.
However, when I combine the class into my project, I find the compiler will get errors such as:
=======
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2065: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
AcronymExtractorView.cpp
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2065: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
MyCrawler.cpp
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2065: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
c:\program files\microsoft visual studio\vc98\include\xlocnum(481) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\xlocnum(479) : while compiling class-template member function 'class std::ostreambuf_iterator<char,struct std::char_traits<char=""> > __thiscall std::num_put<char,class std::ostreambuf_itera
tor<char,struct="" std::char_traits<char=""> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char=""> >,class std::ios_base &,char,long) const'
=======
from google, I find one possible reasons at:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvc/html/msdn_stlfaq.asp
which it says things as:
vector<int, allocator<int="">> iV;
The problem is caused by the consecutive ">>" at the end of the declaration. The solution is to put a space between them, so the above becomes:
is causing the problem.
However, I don't see such thing in my program (at lease no such direct problem as above).
Does anyone know any other possible reasons and how to solve it?
Thanks a lot in advance.
|
|
|
|
|