Click here to Skip to main content
14,325,352 members

Comments by Member 7766180 (Top 200 by date)

Member 7766180 8-Jan-13 20:15pm View
   
Like I said. Lost, Lost, Lost. I have MySQL. I was told to use PHP, Ajax and JScript. Yes I have samples but none are totally working. The best one fills in the first listbox but refuses to update the second one. Is there something amiss in this update code? Cant seem to get the code to paste properly! See original question, its there.
Member 7766180 8-Jan-13 19:19pm View
   
Sounds good! I am coming from an MS Access background, so my thinking isn't up to speed yet! Are there any examples out there that I can start with? Thank you.
Member 7766180 6-Jan-13 15:55pm View
   
Here is the Listbox code.

<form method = "post">
<select name = "RestName" id="RestID">
<option value="-1">--Select--</option>

</select>
<select id = "RestID" id="CityID">
<option value="-1">--Select--</option>

</select>
<select id="RestID" id="AreaID">
<option value="-1">--Select--</option>

</select>
</form>
Member 7766180 14-Oct-12 11:00am View
   
Thank you for your help. I appreciate it.
Member 7766180 13-Oct-12 15:39pm View
   
Thank you. I now see what I did wrong. I appreciate the help.
Member 7766180 12-Jul-12 17:18pm View
   
Thank you. I will look into Twilio. The card thing sounds a bit on the overkill side (for now). The Twitter thing might possibly work. What I'm trying to do is send a text message back to the office computers, they would be collected and placed in a database.
Member 7766180 12-Jul-12 12:58pm View
   
Thank you. This helps a lot. Do you happen to know the particulars of what your friend purchased?
Member 7766180 27-Nov-11 12:38pm View
   
Thank you. However; I forgot to mention that I have a console app. So I need the refresh to just run.
Member 7766180 10-Nov-11 2:36am View
   
I need the 0.0.0.0 for the code to keep running.
Member 7766180 9-Nov-11 21:51pm View
   
Thank you.
Member 7766180 9-Nov-11 21:42pm View
   
I'm sure it is. Am
i going to have problems with strcmp()? Is there a way with string class even though I don't know thw IP Addresses? Thank you.
Member 7766180 9-Nov-11 21:36pm View
   
Thats great except I don't know the IP addresses. They are variables..addr2 and ipSrc.

Something like this?
pHostEnt2 = gethostbyname(NewLogURL.c_str());
ppaddr2 = (int**)pHostEnt2->h_addr_list;
sockAddr2.sin_addr.s_addr = **ppaddr2;
addr2 = inet_ntoa(sockAddr2.sin_addr);
char currentaddress[100] = { 0 };
strcpy( currentaddress, inet_ntoa(sockAddr2.sin_addr ) );

Getting even more lost!
Member 7766180 9-Nov-11 21:28pm View
   
You mean change the pointers into strings, and then use == ?
Member 7766180 9-Nov-11 21:17pm View
   
Are you saying use this instead?

if (addr2.compare(ipSrc) != 0)
cout << addr2 << " is not " << ipSrc << "\n";
Member 7766180 9-Nov-11 21:07pm View
   
This works well, except I can't change addr2 to char addr2[20] VS 2010 is kicking and screaming!
Member 7766180 9-Nov-11 20:55pm View
   
They are both IP addresses as strings.
Member 7766180 9-Nov-11 19:57pm View
   
OK I moved the addr2/currentaddress to a global variable in the header file and I can now access it. Thank you.
Member 7766180 9-Nov-11 19:15pm View
   
Thank you Jack, So does this replace everything I have posted in the question? Also how do I reference the hostIP in mycpp file? I'm sorry, kinda new only been doing this since the springtime.
Member 7766180 9-Nov-11 17:38pm View
   
Thank you Jack. What I am trying to do is get the value of currentaddress so that I can use it in my cpp file. Right now it's in a header file. If you want I can post the entire function, if that helps.
Member 7766180 9-Nov-11 17:25pm View
   
Thank you Jack. It gives me the same error.
Return Value Type Doesn't Match Function Type. Am I putting it in the wrong place? Or what...........?

HOSTENT *pHostEnt2;
int **ppaddr2;
SOCKADDR_IN sockAddr2;
char* addr2;
pHostEnt2 = gethostbyname(NewLogURL.c_str());
ppaddr2 = (int**)pHostEnt2->h_addr_list;
sockAddr2.sin_addr.s_addr = **ppaddr2;
addr2 = inet_ntoa(sockAddr2.sin_addr);
char currentaddress[100] = { 0 };
strcpy( currentaddress, inet_ntoa(sockAddr2.sin_addr ) );
if( currentaddress != NULL && currentaddress[0] == '\0')
{
}
const char * getCurrAdd(const char * currentaddress);
{
return currentaddress;
}
Member 7766180 9-Nov-11 16:47pm View
   
OK I tried this...

addr2 = inet_ntoa(sockAddr2.sin_addr);
char currentaddress[100] = { 0 };
strcpy( currentaddress, inet_ntoa(sockAddr2.sin_addr ) );
printf("\n Current Website IP:%s", currentaddress);

//char getCurrAdd(char currentaddress);
//{
//return currentaddress;
//}

But it says that return value type doesn't match function type.
Member 7766180 9-Nov-11 16:46pm View
   
Thank you. I will try that.
Member 7766180 9-Nov-11 16:29pm View
   
Thank you Chuck. Gettin there!
Member 7766180 9-Nov-11 16:28pm View
   
Your right. It does return a NULL. How can I make it return 0.0.0.0 if its NULL? I will take your advice about the getaddrinfo as well. Also I did the copying of the string as advised. Thank you.
PS. now that I have the string copied can I reference this string from my CPP file. The string is in a header file.
Member 7766180 9-Nov-11 16:15pm View
   
Thank you. OK I think I get what you are saying. I will try it now.

Have this...

addr2 = inet_ntoa(sockAddr2.sin_addr);
char currentaddress[100] = { 0 };
strcpy( currentaddress, inet_ntoa(sockAddr2.sin_addr ) );
printf("\n Current Website IP:%s", currentaddress);

char getCurrAdd(char currentaddress);
{
return currentaddress;
}

ut it says return value does not match function type?
Member 7766180 9-Nov-11 14:27pm View
   
Actually it's returning about:blank..what seems to be hanging the code are these lines...

ppaddr = (int**)pHostEnt->h_addr_list;
sockAddr.sin_addr.s_addr = **ppaddr;
addr = inet_ntoa(sockAddr.sin_addr);
printf("\n Current Website IP:%s", addr);

Perhaps on this line...
addr = inet_ntoa(sockAddr.sin_addr);
I could do...
if addr = NULL then
addr = 0.0.0.0
else
addr = addr
end if
Member 7766180 8-Nov-11 23:45pm View
   
OK, OK point taken! Thank you.
Member 7766180 8-Nov-11 23:39pm View
   
Yes it works. Affirmation would be nice!
Member 7766180 8-Nov-11 23:24pm View
   
Like this?

int Newlength = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, NULL, 0, NULL, NULL);
std::string NewLogURL(Newlength+1, 0);
int Newresult = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, &NewLogURL[0],Newlength+1, NULL, NULL);

HOSTENT *pHostEnt;
int **ppaddr;
SOCKADDR_IN sockAddr;
char* addr;

pHostEnt = gethostbyname(NewLogURL.c_str());

I'm trying Chuck. I really am! I think that I've learned alot, just a start.
Member 7766180 8-Nov-11 21:16pm View
   
Your right. I tried this and received this error.

The code.....
BSTR bstr;
pBrowser->get_LocationURL(&bstr);
std::wstring wsURL;
wsURL = bstr;

size_t DSlashLoc = wsURL.find(L"://");
if (DSlashLoc != wsURL.npos)
{
wsURL.erase(wsURL.begin(), wsURL.begin() + DSlashLoc + 3);
}
DSlashLoc = wsURL.find(L"www.");
if (DSlashLoc == 0)
{
wsURL.erase(wsURL.begin(), wsURL.begin() + 4);
}
DSlashLoc = wsURL.find(L"/");
if (DSlashLoc != wsURL.npos)
{
wsURL.erase(DSlashLoc);
}
wprintf(L"\n Current Website URL: %s\n\n", wsURL.c_str());

HOSTENT *pHostEnt;
int **ppaddr;
SOCKADDR_IN sockAddr;
char* addr;
pHostEnt = gethostbyname(wsURL.c_str());
ppaddr = (int**)pHostEnt->h_addr_list;
sockAddr.sin_addr.s_addr = **ppaddr;
addr = inet_ntoa(sockAddr.sin_addr);
printf("\n Current Website IP:%s", addr);

1 IntelliSense: argument of type "const wchar_t *" is incompatible with parameter of type "const char *"
Member 7766180 8-Nov-11 21:01pm View
   
Yes I see the quotation marks. You right, they don't belong there.
I tried this...
std::wstring site;
site = wsURL.c_str();
pHostEnt = gethostbyname(site);
and get this error.
1 IntelliSense: no suitable conversion function from "std::wstring" to "const char *" exists
Member 7766180 8-Nov-11 17:53pm View
   
This works...
wprintf(L"\n URL: %s\n\n", wsURL.c_str());
int length = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, NULL, 0, NULL, NULL);
std::string LogURL(length+1, 0);
int result = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, &LogURL[0],length+1, NULL, NULL);
myfile << "\n URL:" << LogURL;
Member 7766180 8-Nov-11 16:51pm View
   
Is this closer?
char LogURL;

WideCharToMultiByte( CP_ACP,WC_COMPOSITECHECK, wsURL.c_str(), -1, LogURL, sizeofLogURL, NULL, NULL);

myfile << "\n URL:" << LogURL;
Member 7766180 8-Nov-11 16:33pm View
   
I did. I guess I didn't understand it!
Member 7766180 8-Nov-11 16:27pm View
   
I tried this..and I'm getting a number.
wchar_t LogURL = WideCharToMultiByte( CP_UTF8, 0, wsURL.c_str(), -1,NULL, 0, NULL, NULL);
myfile << "\n URL:" << LogURL;

will try wofstream now. the problem is that I am already using ofstream everywhere else and it's just this one line.
Member 7766180 8-Nov-11 13:27pm View
   
Thank you Richard! Just one question.....How does one do this?
myfile is an instance of ofstream
Member 7766180 8-Nov-11 12:36pm View
   
Thank you Andrew! You are a God!
Member 7766180 8-Nov-11 12:10pm View
   
Got Thank you.
Member 7766180 8-Nov-11 11:50am View
   
Thank you Andrew. I made a new header file and include what you suggested and it works fine. I did that before and called PrintBrowserInfo(IWebBrowser2 *pBrowser) was I calling the wrong thing? Was that not callable? I see what you did. I wil remember this in the future. Thank you. BTW I have never seen a web address without www. what other options are there? Thank you once again.
Member 7766180 7-Nov-11 23:25pm View
   
OK that toast that idea! Perhaps a way to be notified if its the top most window?
Member 7766180 7-Nov-11 22:09pm View
   
OK. I moved this into the spot of the cpp file...
CoInitialize(NULL);
SHDocVw::IShellWindowsPtr spSHWinds;
IDispatchPtr spDisp;
if (spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) == S_OK)
{//if one open
long nCount = spSHWinds->GetCount();
for (long i = 0; i < nCount; i++)
{//for open
_variant_t va(i, VT_I4);
spDisp = spSHWinds->Item(va);
SHDocVw::IWebBrowser2Ptr spBrowser(spDisp);
if (spBrowser != NULL)
{//if open
PrintBrowserInfo((IWebBrowser2 *)spBrowser.GetInterfacePtr());
spBrowser.Release();
}//if close
}//for close
}//if one close
else
{//else open
puts("Shell windows failed to initialise");
}//else close
return 0;

Then I put the entire PrintBrowserInfo() at the end of the cpp file.
I put all of the includes and such with the others in the cpp file.
Now when I run it I get this error...

Error 1 error C3861: 'PrintBrowserInfo': identifier not found
Member 7766180 7-Nov-11 21:19pm View
   
No, I have the header file in the includes of the cpp file.
Member 7766180 7-Nov-11 21:19pm View
   
Very nice answer! I think I know what to do now. Much appreciated. Thank you.
Member 7766180 7-Nov-11 20:58pm View
   
No I'm not sure.
Member 7766180 7-Nov-11 20:51pm View
   
Tried to several times. Won't run.

Error 2 error C2065: 'pBrowser' : undeclared identifier

Error 3 error C2275: 'IWebBrowser2' : illegal use of this type as an expression
Member 7766180 7-Nov-11 20:21pm View
   
I dropped this in and I am getting these errors.

printf("\n Source IP: %s", ipSrc);
myfile << "\n Source IP:" << ipSrc;
PrintBrowserInfo(IWebBrowser2 *pBrowser);

2 IntelliSense: identifier "pBrowser" is undefined
1 IntelliSense: type name is not allowed
Member 7766180 7-Nov-11 19:08pm View
   
This works.

std::wstring wsURL;
wsURL = bstr;
size_t DSlashLoc = wsURL.find(L"//www.");
if (DSlashLoc >= 0)
{
wsURL.erase(wsURL.begin(), wsURL.begin() + DSlashLoc + 6);
}
DSlashLoc = wsURL.find(L"/");
if (DSlashLoc != wsURL.npos)
wsURL.erase(DSlashLoc);
wprintf(L" URL: %s\n\n", wsURL.c_str());
Member 7766180 7-Nov-11 16:14pm View
   
Should be a way to erase everything to the right of "/" including "/"?
Member 7766180 7-Nov-11 15:59pm View
   
Not sure what you mean?
Member 7766180 7-Nov-11 15:58pm View
   
OK, I ran it and I am getting this..The original

URL: http://www.codeproject.com/Questions/279676/Getting-The-Basic-Web-Address



With your code
URL: www.codeproject.comQuestions/279676/Getting-The-Basic-Web-Address
Member 7766180 7-Nov-11 15:47pm View
   
This looks doable for me (at my level) except I'm getting an error on this.
std::wstring wsURL = bstr;
wtring is not a member of std.
Member 7766180 7-Nov-11 15:42pm View
   
Another great answer!
Member 7766180 7-Nov-11 15:34pm View
   
Great answer! It's only through my lack of knowledge that I know how to implement it. I tried this and it did not work.

pBrowser->get_LocationURL(&bstr);
wprintf(L" URL: %s\n\n", bstr);
System.Uri uri = new System.Uri(bstr);
string host = usi.Host;
wprintf(L" URL: %s\n\n", usi);
SysFreeString(bstr);
Member 7766180 7-Nov-11 2:48am View
   
This is grear! Thank you!
Member 7766180 7-Nov-11 0:27am View
   
OK, confused as usual. I just want the URL that is visible in the address bar. How would I modify my code to do that? I'm only getting an "E" in data received. sent = send(sniff_socket, "GET / HTTP/1.0 ", 16, 0);
Thank you.
Member 7766180 6-Nov-11 23:50pm View
   
Thank you. However; I can't seem to find anything about grabbing the URL of the current web page.
Member 7766180 6-Nov-11 16:45pm View
   
OK thats a good answer!
Member 7766180 6-Nov-11 16:17pm View
   
Mehdi I know how to get it. I need to know when is the last write time. When the write starts or when it ends?
Member 7766180 6-Nov-11 0:39am View
   
This is what I wanted to know!

PS, mathematically 0 seconds is <= 2 seconds so there's nothing you should change.

I will check the typecast. Thank you.
Member 7766180 5-Nov-11 23:45pm View
   
Ok, It's all in the question now. As written does it run the code based on a file that is 2 seconds old or less, including 0 seconds?
Member 7766180 5-Nov-11 23:11pm View
   
This is what I have so far...

void PASS(tFoundFilesVector &fileList)
{//Pass Open
unsigned _int64 fileTime, curTime, age;
tFoundFilesVector::iterator iter;
FILETIME ftNow;
CoFileTimeNow(&ftNow);
curTime = ((_int64) ftNow.dwHighDateTime << 32) + ftNow.dwLowDateTime;

for (iter=fileList.begin(); iter<filelist.end(); iter++)=""
="" {="" for="" open="" filetime="((_int64)iter-">ftLastWriteTime.dwHighDateTime << 32) + iter->ftLastWriteTime.dwLowDateTime;

age = curTime - fileTime;

if (age <= (_int64)20000000UL)// 2 Seconds
Member 7766180 3-Nov-11 22:55pm View
   
Here is the message...
1 IntelliSense: identifier "ipSrc" is undefined
Member 7766180 3-Nov-11 22:43pm View
   
I have a CPP file with a variable. When I try to reference this variable from my header file, it says that it's not found. Is this clearer?
Member 7766180 3-Nov-11 12:41pm View
   
So I did this, it doesn't move as you said.

DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
::Sleep(5000);
rename("c:\\PASS\\airport.zip", "c:\\Users\\DS\\Downloads\\airport.zip");
return 0;
}

int main()
{
HANDLE hThread = ::CreateThread(NULL, NULL, ThreadProc, NULL, NULL, NULL);
CloseHandle(hThread);
return 0;
}
Member 7766180 3-Nov-11 12:36pm View
   
This is part of a larger program. When the program runs I want it to wait five seconds then move the file and exit. Right now, in the stand alone version it's moving the file and closing the console in five seconds, but I don't know if the file is being moved right away or waiting five seconds and then moving.
Member 7766180 3-Nov-11 12:26pm View
   
Correct Chuck, I just want to move any file(s)from PASS to Downloads.
Member 7766180 3-Nov-11 11:27am View
   
OK, This works. Sorry couldn't get back sooner, Internet out for a bit, (the big winter storm). Here is what I have.

#include "stdafx.h"
#include <time.h>
#include <windows.h>
#include <iostream>

DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
rename("c:\\PASS\\airport.zip", "c:\\Users\\DS\\Downloads\\airport.zip");
return 0;
}

int main()
{
HANDLE hThread = ::CreateThread(NULL, NULL, ThreadProc, NULL, NULL, NULL);
CloseHandle(hThread);
::Sleep(5000);
return 0;
}

Thank you Chuck.
Member 7766180 1-Nov-11 11:46am View
   
Thank you Chuck. Will try as soon as I get back.
Member 7766180 1-Nov-11 11:17am View
   
Here is the thing, First I need to set it to 5 seconds and second I need it to run while other code is running in the main program. In other words I don't want my main program to hang while this executes. So basically once this code is triggered, it waits five seconds, then moves the file without interferring with anything else, can this and is this being done here? Thank you.
Member 7766180 1-Nov-11 1:11am View
   
Hmmm! So is there a shorter way to write a timer that will move this file in lets say 5 aeconds?
Member 7766180 1-Nov-11 0:47am View
   
No, that is why I am asking for help.
Member 7766180 1-Nov-11 0:27am View
   
Problem fixed. I forgot to add the file name to the second part! Time for bed.
Member 7766180 31-Oct-11 20:52pm View
   
Chuck, I have no idea where the garbage comes from. It seems to be working now. There are no other lines in sight!
Member 7766180 31-Oct-11 13:54pm View
   
Apparently, The space was printing something at times. This seems to have fixed the problem. myfile << "\n Sequence Number: "<< ntohl(tcp_header->seq_number)<< "\n";
Member 7766180 31-Oct-11 13:52pm View
   
Thank you! I'm good to go. Have a nice day, Nishant.
Member 7766180 31-Oct-11 13:50pm View
   
Thnak you. I appreciate the input!
Member 7766180 31-Oct-11 13:50pm View
   
Chuck, Put this in a solution so that I may give you credit.
Member 7766180 31-Oct-11 13:47pm View
   
Thank you. I understand what you are saying. How long are sequence numbers? I'm getting anywhere from 6 to 9 digits.
Member 7766180 31-Oct-11 13:44pm View
   
This works...
myfile << "\n Sequence Number: "<< ntohl(tcp_header->seq_number)<< "\n";
Member 7766180 31-Oct-11 13:41pm View
   
See above I forgot to include a line. The problem is that it doesn't always print garbage. Just sometimes. I just need a space.
Member 7766180 31-Oct-11 13:38pm View
   
Right again Chuck. Here is the complete package...
printf("\n Sequence Number : %lu\n", ntohl(tcp_header->seq_number));
myfile << "\n Sequence Number: "<< ntohl(tcp_header->seq_number);
myfile << "\n ";

I just need the last line to be a spacer. Am I doing it wrong?
Member 7766180 31-Oct-11 13:34pm View
   
Deleted
Thank you. I am using ANSI. So how can I fix this? I am not on a secure connection.
Member 7766180 31-Oct-11 13:34pm View
   
Thank you. I am using ANSI. So how can I fix this? I am not on a secure connection.
Member 7766180 31-Oct-11 13:33pm View
   
Thank you. I am not on a secure connection. Also I am using ANSI (Multi-byte). How can I correct this?
Member 7766180 26-Oct-11 22:26pm View
   
OK its working now. Thank you very much. The only concern that I now have is what Chuck was worried about? Is this a concern? Thank you.
Member 7766180 26-Oct-11 22:19pm View
   
The corrected code///

void decode_tcp(char *_packet)
{
TCPHEADER *tcp_header = (TCPHEADER *)_packet;
BYTE flags = ( ntohs(tcp_header->info_ctrl) & 0x003F );

if ( flags & 0x01 ) // FIN
{
printf("\n FIN " );
myfile << "\n FIN " ;
}
if ( flags & 0x02 ) // SYN
{
printf("\n SYN " );
myfile << "\n SYN " ;
}
if ( flags & 0x04 ) // RST
{
printf("\n RST " );
myfile << "\n RST " ;
}
if ( flags & 0x08 ) // PSH
{
printf("\n PSH " );
myfile << "\n PSH " ;
}
if ( flags & 0x10 ) // ACK
{
printf("\n ACK " );
myfile << "\n ACK " ;
}
if ( flags & 0x20 ) // URG
{
printf("\n URG " );
myfile << "\n URG " ;
}
printf("\n Sequence Number : %lu\n", ntohl(tcp_header->seq_number));
myfile << "\n Sequence Number: "<< ntohl(tcp_header->seq_number);
myfile << "\n ";
}
Member 7766180 26-Oct-11 22:17pm View
   
Thanks Richard I added the brackets and now it prints when needed.
Also, One other thinh occasionaly I get this garble stuff, what could that be?

ACK
Sequence Number: 41183825
»ìtjQ*GPúð¢
Source IP:207.46.15.253
Destination IP:192.168.1.105
Wed Oct 26 22:12:45 2011

ACK
Sequence Number: 41185285
»ìtp*GPúðKš
No Action Required:
Source IP:207.46.15.253
Destination IP:192.168.1.105
Wed Oct 26 22:12:45 2011

PSH
ACK
Sequence Number: 41186745
»ìtu¹*GPúðˆü
Member 7766180 26-Oct-11 20:08pm View
   
Ok that just confused me. I have this one.cpp, fail.h and now the abc.h. abc.h has the three lines that you posted first. one.cpp includes abc.h iostream.h and ofstream myfile; fail.h has abc.h and iostream.h
Member 7766180 26-Oct-11 20:00pm View
   
OK Andrew. I made a header file named abc.h and it includes you fie=rst block of code. I have only one cpp file, so at the beginig of that file I put #include "abc.h" At the top of the fail.h file I also put "abc.h" Is this correct?
Member 7766180 26-Oct-11 19:48pm View
   
Thanks Richard. Well, well, well. It seems that this problem is not solved. It's printing all of the flags, all of the time. Not just the ones that are being reflected in printf. So maybe these are the wrong lines to do the myfile on?
Member 7766180 26-Oct-11 19:38pm View
   
OK Andrew I put this t the top of the header file.

extern ofstream myfile;
and turned the others just into myfile
Is this what you met?
Member 7766180 26-Oct-11 19:06pm View
   
Right I do have it in the cpp in one place only above the main()
Member 7766180 26-Oct-11 19:05pm View
   
So what to do?
Member 7766180 26-Oct-11 19:03pm View
   
all of the references are gone. I just have it in the one area above main() as such..
ofstream myfile;
Member 7766180 26-Oct-11 19:02pm View
   
Tried this and it doesn't work...
extern ofstream myfile << "\n Delete :";
Member 7766180 26-Oct-11 18:13pm View
   
Thank you, I will check it out.
Member 7766180 26-Oct-11 14:16pm View
   
Needed a second. It's done.
Member 7766180 26-Oct-11 14:09pm View
   
BINGO....I removed "ofstream myfile;" from both main() and decode_tcp(), put it up above with all of the other stuff. #includes..etc. and it works!
Thank you so much Chuck!
Member 7766180 26-Oct-11 14:05pm View
   
I have it declared in main() and in decode_tcp().
Member 7766180 26-Oct-11 13:53pm View
   
They are printed seperately, not together.
Member 7766180 26-Oct-11 13:52pm View
   
I get this...
Source IP:50.22.100.250
Destination IP:192.168.1.105
Wed Oct 26 13:48:39 2011

No Action Required:
No Action Required:
Source IP:50.22.100.250
Destination IP:192.168.1.105
Wed Oct 26 13:48:39 2011

No Action Required:
No Action Required:
No Action Required:
No Action Required:
Source IP:50.22.10
FIN 0
SYN 2
RST 0
PSH 0
ACK 16
URG 0
Sequence Number :724588489
FIN 0
SYN 0
RST 0
PSH 0
ACK 16
URG 0
Sequence Number :725704959
FIN 0
SYN 0
RST 0
PSH 8
ACK 16
URG 0
Sequence Number :725704959
FIN 1
Member 7766180 26-Oct-11 13:51pm View
   
So if I do this..
void decode_tcp(char *_packet)
{
ofstream myfile;
myfile.open ("C:\\test.txt",ios::out | ios::app);
TCPHEADER *tcp_header = (TCPHEADER *)_packet;
BYTE flags = ( ntohs(tcp_header->info_ctrl) & 0x003F );

if ( flags & 0x01 ) // FIN
printf("\n FIN " );
myfile << "\n FIN " <<( flags & 0x01 ) ;
if ( flags & 0x02 ) // SYN
printf("\n SYN " );
myfile << "\n SYN " <<( flags & 0x02 );
if ( flags & 0x04 ) // RST
printf("\n RST " );
myfile << "\n RST " <<( flags & 0x04 );
if ( flags & 0x08 ) // PSH
printf("\n PSH " );
myfile << "\n PSH " <<( flags & 0x08 );
if ( flags & 0x10 ) // ACK
printf("\n ACK " );
myfile << "\n ACK " <<( flags & 0x010 );
if ( flags & 0x20 ); // URG
printf("\n URG " );
myfile << "\n URG " <<( flags & 0x020 );
printf("\n Sequence Number : %lu\n", ntohl(tcp_header->seq_number));
myfile << "\n Sequence Number :"<< ntohl(tcp_header->seq_number);
myfile.close();
}
Member 7766180 26-Oct-11 13:38pm View
   
As you can see no flags or sequence number.
Member 7766180 26-Oct-11 13:38pm View
   
The text file..
Source IP:74.217.252.37
Destination IP:192.168.1.105
Wed Oct 26 13:34:54 2011

No Action Required:
Source IP:64.208.138.133
Destination IP:192.168.1.105
Wed Oct 26 13:34:54 2011
Member 7766180 26-Oct-11 13:36pm View
   
The Terminal
TCP Header:
Source IP: 174.129.225.194
Destination IP: 192.168.1.105
Wed Oct 26 13:34:57 2011

SYN
ACK
URG
Sequence Number : 676534648

-------------------- // --------------------
TCP Header:
No Action Required:
-------------------- // --------------------
TCP Header:
Source IP: 174.129.225.194
Destination IP: 192.168.1.105
Wed Oct 26 13:35:03 2011

SYN
ACK
URG
Sequence Number : 676534648
Member 7766180 26-Oct-11 13:24pm View
   
Quite allright
Member 7766180 26-Oct-11 13:24pm View
   
Tried this.
decode_tcp(&packet[ip_header_size]);
myfile << decode_tcp(&packet[ip_header_size]);
getting error on the << it says no operator matches these operands
Member 7766180 26-Oct-11 13:16pm View
   
The log file prints fine, it's just not including the flags from the function that I posted. If I declare, open, close on the function itself it prints the flags seperate not with the source, desitination and date it pretains to.
Member 7766180 26-Oct-11 13:12pm View
   
Not a guy :)
Member 7766180 26-Oct-11 13:10pm View
   
The opening...
int main( int _argc, char *_argv[] )
{//Main Open
ofstream myfile;
myfile.open ("C:\\test.txt",ios::out | ios::app);
struct sockaddr_in sock_sniff;
SOCKET sniff_socket = -1;
WSAData sa_data;
Member 7766180 26-Oct-11 13:08pm View
   
This is what I am getting in the console window.
TCP Header:
Source IP: 65.39.148.34
Destination IP: 192.168.1.105
Wed Oct 26 13:06:24 2011

PSH
ACK
URG
Sequence Number : 532047134

The log file is printing all of the flags and sequence numbers seperate from the IP source, etc. In the console window they are together (as shown)
Member 7766180 26-Oct-11 13:05pm View
   
No, this is a different issue. The log prints fine as you suggested. I'm having a new problem of including the results of this function.
Member 7766180 26-Oct-11 12:59pm View
   
Sorry, you were quicker than I. I shan't do that again! I'm just copying the output of print. I tried declaring, and opening at the very start of main, and closing it just before exit, it prints ecerything but this function.
Member 7766180 26-Oct-11 12:50pm View
   
The code from the main().
else // to 0 else
{//IP To 0 Else Open
printf("\n Source IP: %s", ipSrc);
myfile << "\n Source IP:" << ipSrc;
printf("\n Destination IP: %s", ipDest);
myfile << "\n Destination IP:" << ipDest;
////////////////////////////////////////
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ("\n %s", asctime (timeinfo) );
myfile << "\n "<< asctime (timeinfo) ;
////////////////////////////////////////////
decode_tcp(&packet[ip_header_size]);
char *_packet;
_packet = &packet[ip_header_size];
TCPHEADER *tcp_header = (TCPHEADER *)_packet;
BYTE flags = ( ntohs(tcp_header->info_ctrl) & 0x003F );

I tried declaring, opening and closing on the function, but it prints it completely seperate from everything else. My guess is that somehow I have to put myfile..... somewhere on the the function in the main() part?

Member 7766180 26-Oct-11 12:33pm View
   
Everything that you see above that starts with myfile...
Member 7766180 25-Oct-11 13:41pm View
   
I have to write to C:\ I have no other drives on my computer. But it is working now, thank you.
Member 7766180 25-Oct-11 13:37pm View
   
This works
myfile.open ("C:\\test.txt",ios::out | ios::app);
myfile <<"\n No Action Required:";
myfile << "\n Source IP:" << ipSrc;
myfile << "\n Destination IP:" << ipDest;
Member 7766180 25-Oct-11 13:18pm View
   
Thank you SA and Chandru080. I'm getting the output now. The next problem is that I have several of these sprinkled throughout the code. "myfile << "\n Source IP: " << ipSrc;" but the output prints only one, I have the close t the end of the program. Do I have to set this up differently to get all of them to print to file, do I have to append to the file somehow? Thank you.
Member 7766180 25-Oct-11 13:15pm View
   
Yes this prints, thank you,
Member 7766180 25-Oct-11 12:49pm View
   
Thank you for showing me. I was trying to fix it ut it keep getting worse.
Member 7766180 24-Oct-11 19:08pm View
   
Yes I do Chuck. Thank you as well!
Member 7766180 24-Oct-11 19:08pm View
   
Thank you Espen, works great!
Member 7766180 24-Oct-11 14:19pm View
   
Tried it and it doesn't work. I'm runnig ansi on all of this and it's been working fine. If I put an actual ip address in like this '173.201.2.2' ,the code will run as predicted. I don't think it's seeing the ip address. I think it's seeing just ipSrc. It works in Access with an actual IP address.
Member 7766180 21-Oct-11 7:43am View
   
Thank you Chuck. I will put a way my new toy BIG HAMMER and only use it for cranky compilers. Lessson learned. The whole problem stems from the sample code I started with. It was counting rows whereas I needed to pull information from a field. Unfortunatly, there was only one example I could find using Access and C++, (seems to me that this is uncommon) so I ran with that example. I tried using mySQL as a backend and Access as a frontend with C++ but that was just too much for me at this point, so I went with the path of least resistance. Access and C++. This is just for a proof of concept so if there are some loose ends. So be it. Shortly I will be hiring a full staff of experienced programmers to do the work. I just want to see if this could be done. Right now it's working and that is good! Thank you for your help.
Member 7766180 21-Oct-11 7:22am View
   
Thank you Stefan. I appreciate the comments. So from what I gather I don't even need to put QUOTA in front of the statements? I only did it because thats what the Microsoft example had. Also I have no idea how to check the return value of a function, it sounds like a good idea though. Right now with the change in the statement that I did, I no longer have to do any typecasting. The code is connecting to the Microsoft Access database and always returning the correct information. My little applet was done untill I had problems with my server always timing out, and short of paying mega bucks every month for a dedicated server, I decided to move the database to my local machine. This is just for a (POC) proof of concept.I had no idea that it would take so much, thus the recent flurry of questions. I only used chval1[128] because that was the only window I had open at the time. Although it was the wrong window it was a window, nontheless. So aside from learning a number of things, I have it working for now. Thank you for all of the wonderful information!
Member 7766180 20-Oct-11 12:43pm View
   
int var = atoi(chval1);
if (rowCount3 >= var)
returns the not compatible error.......
Member 7766180 20-Oct-11 12:26pm View
   
SQLCHAR* query4 = (SQLCHAR*)"SELECT tblIP.[IPQuota] FROM tblIP WHERE tblIP.[IPAddress] ='173.201.216.2';";

SQLSMALLINT iConnStrLength2Ptr;
SQLCHAR szConnStrOut[255];
SQLCHAR chval1[128];

QUOTA = SQLAllocEnv(&hEnv4);
QUOTA = SQLAllocConnect(hEnv4, &hDbc4);
QUOTA = SQLDriverConnect(hDbc4, NULL, szDSN, _countof(szDSN), szConnStrOut, 255, &iConnStrLength2Ptr, SQL_DRIVER_NOPROMPT);
QUOTA = SQLAllocStmt(hDbc4,&hStmt4);
QUOTA = SQLPrepare(hStmt4, query4, SQL_NTS);
QUOTA = SQLBindCol(hStmt4, 1, SQL_C_CHAR, chval1, 128, &ret1);
QUOTA = SQLExecute(hStmt4);
QUOTA = SQLFetch(hStmt4);
QUOTA = SQLFreeStmt(hStmt4, SQL_DROP);
printf("Quota of IP Address: %d\n", chval1);
SQLDisconnect(hDbc4);
SQLFreeHandle(SQL_HANDLE_DBC, hDbc4);
SQLFreeHandle(SQL_HANDLE_ENV, hEnv4);
Member 7766180 20-Oct-11 12:23pm View
   
This is way I can't initialize it....SQLCHAR chval1[128]; It seems that I need this to get the value to begin with. I tried changing the SQL statement to SQLINTEGER so that I don't have to convert but the SQLPrepare statemet keeps calling for an SQLCHAR, that is why I was asking about te typecast.
Member 7766180 20-Oct-11 12:19pm View
   
Thank you Stefan. The problem I am having with atoi is that SQLCHAR is not compatable with const char. This is what is messing me up on the conversion. SQLCHAR is an unsigned char and SQLINTEGER is an int, you are correct.
Member 7766180 20-Oct-11 11:16am View
   
Thank you Chuck. Good explanation. I tried this and I'm sure in fact I know I have it wrong. What else should I add?

int i;
char chval1 [128];
i = atoi (chval1);
if (rowCount3 >= i)
Member 7766180 20-Oct-11 1:12am View
   
Ok made a mess of things! I think I need further guidance!

int strcmp(int * rowCount3 >= int * chval1)
Member 7766180 20-Oct-11 1:06am View
   
Nope.Works sometimes then sometimes not! ughhhhh!
Member 7766180 20-Oct-11 0:54am View
   
This seems to work...correct me if I'm wrong, please!

if ((SQLCHAR)rowCount3 >= (SQLCHAR)chval1)
Member 7766180 20-Oct-11 0:51am View
   
One More Left!!!
Member 7766180 20-Oct-11 0:51am View
   
Thank you Superman, but what I have it seems to be working. I appreciate the input.
Member 7766180 20-Oct-11 0:50am View
   
Also didn't work!

if ((SQLINTEGER)rowCount3 >= (SQLINTEGER)chval1)
Member 7766180 20-Oct-11 0:44am View
   
This is what I see when I do a printf

printf("Total of Downloads: %d\n",rowCount3);
printf("Quota of IPAddress: %s\n", chval1);

Total of Downloads: 122
Quota of IP Address: 116
Member 7766180 20-Oct-11 0:41am View
   
And this...also did not work.

if (rowCount3 >= chval1[128])
Member 7766180 20-Oct-11 0:39am View
   
Tried This and it didn't work.

if (rowCount3 >= (SQLINTEGER)chval1)
Member 7766180 19-Oct-11 21:58pm View
   
Next One Working...

TOTAL = SQLAllocEnv(&hEnv3);
TOTAL = SQLAllocConnect(hEnv3, &hDbc3);
TOTAL = SQLDriverConnect(hDbc3, NULL, szDSN, _countof(szDSN), szConnStrOut, 255, &iConnStrLength2Ptr, SQL_DRIVER_NOPROMPT);
TOTAL = SQLAllocStmt(hDbc3,&hStmt3);
TOTAL = SQLPrepare(hStmt3, query3, SQL_NTS);
TOTAL = SQLExecute(hStmt3);
TOTAL = SQLFetch(hStmt3);
while (SQL_SUCCEEDED(TOTAL))
{
TOTAL = SQLFetch(hStmt3);
rowCount3++;
};
TOTAL = SQLFreeStmt(hStmt3, SQL_DROP);
printf("Total of Downloads: %d\n",rowCount3);
SQLDisconnect(hDbc3);

SQLFreeHandle(SQL_HANDLE_DBC, hDbc3);

SQLFreeHandle(SQL_HANDLE_ENV, hEnv3);

Two more left!!!!
Member 7766180 19-Oct-11 21:20pm View
   
INSERT working.
he next two problems are the Sum and Select statements.

SQLCHAR* query3 = (SQLCHAR*)"SELECT DownloadIP, Sum(DownloadCount) AS SumOfDownloadCount FROM tblDownloads GROUP BY DownloadIP;";

SQLCHAR* query4 = (SQLCHAR*)"SELECT tblIP.IPAddress, tblIP.IPQuota FROM tblIP WHERE (((tblIP.IPAddress)='173.201.216.2'));";
Member 7766180 19-Oct-11 16:52pm View
   
Some kinda of a joke! Now the INSERT doesn't work!!!!!!!

if (rowCount >= 1)
{
printf("PASS\n");
SQLExecute("INSERT INTO tblDownloads (tblDownloads.[DownloadIP] , tblDownloads.[DownloadCount]) VALUES('173.201.216.2', 1);");

TOTAL = SQLFetch ("SELECT tblDownloads.[DownloadCount] WHERE tblDownloads.[DownloadIP] = '173.201.216.2';");
QUOTA = SQLFetch ("SELECT tblIP.[IPQuota], WHERE tblIPID.[IPAddress] = '173.201.216.2';");

if (TOTAL >= QUOTA)
{
SQLExecute ("UPDATE tblIP SET tblIP.[IPMax] WHERE tblIP.[IPAddress] = '173.201.216.2');");
}
Member 7766180 19-Oct-11 16:48pm View
   
This fixed the undelared identifier...
SQLRETURN rc, TOTAL, QUOTA;
and I removed the int TOTAL and int QUOTA
Member 7766180 19-Oct-11 16:34pm View
   
This comes up with undeclared identifier....
int TOTAL;
TOTAL = SQLFetch ("SELECT tblDownloads.[DownloadCount] WHERE tblDownloads.[DownloadIP] = '173.201.216.2';");
int QUOTA;
QUOTA = SQLFetch ("SELECT tblIP.[IPQuota], WHERE tblIPID.[IPAddress] = '173.201.216.2';");
if (TOTAL >= QUOTA)
{
SQLExecute ("UPDATE tblIP SET tblIP.[IPMax] WHERE tblIP.[IPAddress] = '173.201.216.2');");
}
Member 7766180 19-Oct-11 16:28pm View
   
OK, got the first of three to work...
SQLExecute("INSERT INTO tblDownloads (tblDownloads.[DownloadIP] , tblDownloads.[DownloadCount]) VALUES('173.201.216.2', 1);"); Onward!!!
Member 7766180 19-Oct-11 16:03pm View
   
I think it has something to do with hStmt, I need to use it more than once, so I think I need to release it and reibstitute it.
Member 7766180 19-Oct-11 1:16am View
   
Thank you. I did that.
Member 7766180 18-Oct-11 15:16pm View
   
:)
Member 7766180 18-Oct-11 15:14pm View
   
Thank you Chuck. That was an easy enough solution! I think that my compiler was complaining and that fixed that! I love big hammers! My 100!
Member 7766180 18-Oct-11 12:37pm View
   
Reading it now.
Member 7766180 18-Oct-11 6:55am View
   
Ok. Obviously I wandered down the wrong path here! Using what I am using to make the direct odbc connection with ms access what do I actually need to query my database?
Member 7766180 18-Oct-11 2:52am View
   
No I didn't issue a SQLExecDirect() call. I will Google to find out. So mysql is not relevant I take it! Thank you.
Member 7766180 18-Oct-11 2:44am View
   
Did this...
char queryString[1024];
sprintf(queryString,"SELECT COUNT(*) FROM tblClients");
mysql_query(conn, queryString);
my_ulonglong i = 0;
res_set = mysql_store_result(conn);
my_ulonglong numrows = mysql_num_rows(res_set);
LEGIT = mysql_fetch_row(res_set);
printf("%s: Total of Good %s.\n", queryString);

However; I don't think I can use sprintf with Microsft Access and ODBC? In any case its not returning the answer.
Member 7766180 18-Oct-11 2:37am View
   
It is an SQL Query. Why am I not getting a result? I want a result not a printout as you say and as I am getting. What do I need to do? Thank you.
Member 7766180 16-Oct-11 19:57pm View
   
This works....char* query = "SELECT * FROM tblIP";
Member 7766180 16-Oct-11 19:49pm View
   
Chuck, I have been googling, All Day! Please point me to the link at least, because I can't seem to find it! Thank you.
Member 7766180 16-Oct-11 19:11pm View
   
Thank you. Now my problem is wht is the syntax for a select statement. I tried quotes, parantheses, all kinds of things. How would I word my select statement? I'm connected to the access database, ODBC thats good. I have to be able to query it now.
Member 7766180 16-Oct-11 18:25pm View
   
Yes Chuck it was this statement which worked fine when I queryied the database that was on line. It was mySQL. It is now a local Access 2010 database. I've mde the connection, but now my SELECT statement no longer works! Wht is the problem? Thank you.
Member 7766180 15-Oct-11 20:00pm View
   
Thank you. I am trying to do this with ODBC and without classes.
Member 7766180 12-Oct-11 15:38pm View
   
This is a very good thought out answer! Thank you!
Member 7766180 12-Oct-11 14:35pm View
   
Well I need both, file name and file size. Also CString is giving me a problem.
Member 7766180 12-Oct-11 14:03pm View
   
Oh I see. But tell me Chuck what exactly will the result look like of an assembled packet. I think thats where my confusion lies/ Thank you.
Member 7766180 12-Oct-11 12:15pm View
   
Thank you. I am getting sources and destinations, sequence number and control bits. I have no idea what an assembled packet looks like. I only know that for me to read http headers that I was told to reassembly the packets. Can't find any examples though.
Member 7766180 8-Oct-11 22:33pm View
   
Thank you so very much. It is very appreciated!
Member 7766180 8-Oct-11 15:48pm View
   
OK, I get it. Thank you.
Member 7766180 7-Oct-11 21:32pm View
   
Thank you!
Member 7766180 7-Oct-11 17:45pm View
   
Thank you very much! I appreciate the help! I like how you keep track of your {'s I'm going to do that!
Member 7766180 7-Oct-11 17:22pm View
   
Thank you. I am trying to get rid of zip files that have been downloaded, but not all of them, only those from certain IP's.
Member 7766180 7-Oct-11 17:17pm View
   
I was told that all downloads go there first. I wanted to move a download from a certain IP to a different directory. Right now I'm moving them into two different directorys (PASS) and (FAIL) from the Download Directory, however this doesn't work for me because I need to leave the ones going into the PASS directory in the download directory. Why not leave them there, you ask. I can't because they have to be isolated from the files that are being deleted. I hope this is somewhat clear, if not let me know and I will try to explain again. Thank you.
Member 7766180 7-Oct-11 16:42pm View
   
Holy Cow! That is a wonderful answer! My 100. If I could do it, so I guess I'll have settle on a 5. Thank you.
Member 7766180 7-Oct-11 15:29pm View
   
Thank you Andre. So what I have in Solution 1 should not be used? I'm assuming that your soultion 2 is better than 1. I am basing this on your experience as opposed to mine, which is very little! LOL.
Member 7766180 6-Oct-11 19:02pm View
   
Thank you
Member 7766180 6-Oct-11 19:02pm View
   
Thank you
Member 7766180 6-Oct-11 13:45pm View
   
Bingo! That's simple enough! Thank you. Put it in a solution. Give Credit!
Member 7766180 6-Oct-11 3:17am View
   
Thank you Edward. boolean it is. It's the passing around and storing that confuses me!
Member 7766180 4-Oct-11 20:32pm View
   
It was my understanding that if Count() found no records it would return a 0. However;ifit's returning an error, I guess that is a different story. Is there a way to make it return 0 on error as well? Thank you.
Member 7766180 3-Oct-11 16:49pm View
   
Good example here!
http://support.microsoft.com/kb/157221
Thank you.
Member 7766180 3-Oct-11 5:45am View
   
Thank you, Richard. Goodbye!
Member 7766180 3-Oct-11 5:08am View
   
But Richard it seems to be working! I agree with you, but could you just tell me if I have this right. Deleting 20 seconds or less. I want to go to bed, sign up for college and I'll see you in a couple of years!
Member 7766180 3-Oct-11 5:01am View
   
This seems to work..what do you think?
age = curTime - fileTime;
if (age <= (_int64)200000000UL)
{
wcout << " Delete: '" <<endl;
//remove("*.*");
}
else
{
wcout << " Quit: '" <<endl;
//return;
}
Member 7766180 3-Oct-11 4:36am View
   
unsigned _int64 fileTime, curTime, age; Sorry Richard this is the last piece I need to do, deleting files that are less than 20 seconds. After this I am going to college and take a course, won't be posting for awhile after this, I just need to finish this last piece for myself. Thank you.
Member 7766180 3-Oct-11 4:32am View
   
Stefan, look below Richards solution, please. Thank you.
Member 7766180 3-Oct-11 4:28am View
   
Something was wrong and I couldn't put the tags in. The code was half disappering. Sorry.
Member 7766180 3-Oct-11 4:21am View
   
The Values...
curTime = ((_int64) ftNow.dwHighDateTime << 32) + ftNow.dwLowDateTime;
fileTime = ((_int64)iter->ftLastWriteTime.dwHighDateTime << 32) + iter->ftLastWriteTime.dwLowDateTime;
unsigned _int64 fileTime, curTime, age;
Member 7766180 3-Oct-11 4:20am View
   
Here is the output I am getting...
Found 9 matching files.
Quit: '
FILE: '2.txt', AGE: 91217 seconds
Quit: '
FILE: 'devil.txt', AGE: 2740 seconds
Quit: '
FILE: 'dog.txt', AGE: 32107 seconds
Quit: '
FILE: 'giant.txt', AGE: 32183 seconds
Delete: '
FILE: 'head.txt', AGE: 316 seconds
Quit: '
FILE: 'heston.txt', AGE: 5224 seconds
Delete: '
FILE: 'norman.txt', AGE: 506 seconds
Quit: '
FILE: 'ONEWAY.txt', AGE: 36764 seconds
Quit: '
FILE: 'sj.txt', AGE: 19838 seconds
Press any key to continue . . .
Member 7766180 3-Oct-11 4:18am View
   
Richard, I tried to but it was acting weird and half the code was missing. Tried like 10 times!
Member 7766180 3-Oct-11 3:39am View
   
Thank You.
Member 7766180 2-Oct-11 17:47pm View
   
This is EXACTLY! what I want. Are there any samples of this method anywhere? What is this called? Thank you!
Member 7766180 2-Oct-11 16:49pm View
   
Thank you OriginalGriff for the Expresso Link. My 5!
Member 7766180 2-Oct-11 15:37pm View
   
What else can I do besides having a switch statement with a hundred entries?
Thank you.
Member 7766180 1-Oct-11 19:45pm View
   
So, would I replace it with _WIN32_WINNT_WIN7 (0x0601)in the afxcomctl32.h header or cam I just put it at the start of my cpp file? Thanks.
Member 7766180 1-Oct-11 19:40pm View
   
But I put #define _WIN32_WINNT 0x0403 after I got error. I read that this was the way to fix that error. At least now I know what that line means. But how do you fix it in Win7 and VS2010.
Member 7766180 1-Oct-11 19:08pm View
   
Thank you! Sincerely. my 5. I appreciate it.
Member 7766180 1-Oct-11 16:28pm View
   
Wow! That was the warmest reply I've had. I know I am nowhere near the skill level of the programers here, but I am willing to learn. Unfortunately for me I am a visual learner and this has always caused problems for me in school as well. If I see it, especially in the context of what I am doing I can disassemble and understand it. Most people don't learn that way. When my house burnt down a few years back, and I lost everything...I used visual examples to rebuild it, never built a house in my life. Finished it in 6 months and today it's a showplace. If I had to read, I could never have done it. Thats why, when code is pasted, I learn. too bad for me, because it seems that mot everyone wants to be post code. I don't know why, but it seems that way. Thank you very much for your help, I am going to play around with it even though it has lines thru it. I appreciate your input and I really like your attitude, if more people had it, the world would be a great place to live in!!!!!!
Member 7766180 1-Oct-11 15:04pm View
   
Thank you enkzflep. I used a map because that is what I started with. But your solution looks good. I appreciate the help! Sincerely.
Member 7766180 1-Oct-11 14:53pm View
   
Thank you, Espen. I will look into it.
Member 7766180 1-Oct-11 5:05am View
   
Thank you Richard, I'll tackle it in the morning 5:00 am here. I want to be awake for this, I appreciate your help!
Member 7766180 1-Oct-11 4:19am View
   
Richard I would like to add it at the time the file is found then add it to the list. So am I right where it is or do I need to move it, and if I do.Move it to where? Thank you.
Member 7766180 30-Sep-11 23:46pm View
   
GetSystemTimeAsFileTime(&ftNow);
auto ftAs64 = ftNow.dwLowDateTime + ((unsigned __int64)ftNow.dwHighDateTime << 32) - 6000000000UL;
FILETIME ftOneMinuteAgo = { (DWORD)ftAs64, (DWORD)(ftAs64 >> 32) };
FileTimeToSystemTime(&ftNow, &st);
wsprintf(buf, L"%d-%02d-%02d",st.wYear, st.wMonth, st.wDay);
Member 7766180 30-Sep-11 23:46pm View
   
Albert, I did fix it. I removed it and the code compiled. "Waiting for code handouts" I expected more from you. That wasn't very nice. You don't know how much reading and googling I do to come up with solutions. Do you think I just post, go have some iced tea, then check for an answer. You are sadly mistaken. I really thought that you were better than that. (You act like it's a sin to post code) I've given away a lot of VB code to people in need, and guess what, IT FELT GOOD to help.