|
i want to send sms to a mobile phone depending on some event occurence in my main application.i read some documentation on the net and wat i found out was i need a GSM module and then feed it with some AT commands in order to send the sms. i want to know if thats the right procedure and the quicker one.also how do i actually send the AT command to the the GSM module.i am programming using VC++6.
mahesh
|
|
|
|
|
Hello, i have a problem in the communication between computers with sockets because when i connect with the server i recieve a verification that i am connected but also i want to send the file list of c:\ and i don't know how. Somebody can say me how or write me the esential lines of code.
Thanks you very much.
|
|
|
|
|
Hi densitet,
You can send a file, by converting it to the stream of data.
e.g
Machine1 - Open that file, read the content and send it.
Machine2 - Write the recieved stream/data to file, to get your original file.
I think this is the simplest way to transfer the file using socket !
Gud Luck !
Cheers,
Vishal
|
|
|
|
|
Hi vishalmore,
I don't know if i'm understanding because i'm very new with the sockets but i only want that the server send me the files that it has in c:\ but i don't want the file, only the list
Thankyou
|
|
|
|
|
HI Densitet!!
if you are successful in connecting Sockets, i.e. you can send "hello" between Server and Client then this piece of logic to send the c:\ file List between two computer.
->after connecting socket, enumerate the all the file present in the C:\ using FindFirstFile and FindNextFile or you can use this wrapper
http://www.codeproject.com/file/win32findfile.asp
Now copy all file name in a single string separated by some separator (u can use ';' for that) i.e.
if your c:\ for example contain these file 1.txt 7.exe and fatman.mpg then you string be something like this 1.txt;7.txt;fatman.mpg; send this string to server and on server end parse this string to get actual file list.
"I Think this Will Help"
[Vote One Here, Complete my Survey....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Aloak,
Gud explanation, thnx nways to ease the job
Cheers,
Vishal
|
|
|
|
|
If some one of you have the idea of how to access the windows default mouse handling function, whereby the mouse responds the same (with the same context menus etc) as it does on Normal desktop. This is a part of my final year project.
Ikramullah
|
|
|
|
|
Perhaps you could use SetCursorPos() to move the mouse and post standard mouse related messages to the desktop window (CWnd::GetDesktopWindow() )?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
What I'm attempting to do here is access the memory of a process which i have already created for 'read' purposes. I feel that I'm close, but can't quite get it to work and its chalenging. After reading i then want all the info of the memory read to be displayed and save into a file
I need to have finished this by the end of the week, pliz assist.
Part of the code is below:
int main(int argc, char **argv)
{
PROCESS_INFORMATION pi; /* filled in by CreateProcess */
STARTUPINFO si; /* startup info for the new process*/
HANDLE hProcess = pi.hProcess;
BYTE buf[2000];
DWORD bufsize = sizeof buf;
DWORD baseaddr = 1;
DWORD error = GetLastError();
LPCVOID lpAddress;
PMEMORY_BASIC_INFORMATION lpBuffer;
DWORD dwLength;
DWORD flNewProtect;
PDWORD lpflOldProtect;
DWORD dwSize =0;
LPCVOID lpBaseAddress;
DWORD nSize;
LPDWORD lpNumberOfBytesRead;
printf("Process %d reporting for creation\n",GetCurrentProcessId());
GetStartupInfo(&si);
// Call CreateProcess, telling it to run an exe file
CreateProcess(NULL, /* lpApplicationName */
"numbers.exe", /* lpCommandLine assumes to use curent process directory*/
NULL, /* lpsaProcess */
NULL, /* lpsaThread */
FALSE, /* bInheritHandles */
CREATE_NEW_CONSOLE, /* dwCreationFlags */
NULL, /* lpEnvironment */
NULL, /* lpCurDir */
&si, /* lpStartupInfo */
&pi /* lpProcInfo */
);
printf("New Process ID: %d ",pi.dwProcessId);
printf("has started \n");
//============================================
OpenProcess(
PROCESS_ALL_ACCESS, // access flag
0, // handle inheritance flag
pi.dwProcessId // process identifier
);
//===============================================
GetModuleHandle(
"numbers.exe" // address of module name to return handle
// for
);
//============================================================
// ImageNtHeader(
// 1
// );
//============================================================
VirtualQueryEx(
hProcess, // handle to process
lpAddress, // address of region
lpBuffer,// address of information buffer
dwLength // size of buffer
);
//==========================================================
//*to avoid crashing
VirtualProtectEx(
hProcess, // handle to process
lpAddress, // address of region of committed pages
dwSize, // size of region
flNewProtect, // desired access protection
lpflOldProtect // address of variable to get old protection
);
//============================================================
ReadProcessMemory(hProcess,
lpBaseAddress,
lpBuffer,
nSize, //number of bytes to ead from process*/
lpNumberOfBytesRead //number of bytes transfered*/
);
ZeroMemory(buf, sizeof(buf));
if( ReadProcessMemory( hProcess, &baseaddr, &buf, bufsize, NULL ) == FALSE )
{
printf("\nProcess memory read failed");
_exit(1);
}
else
printf("\nProcess memory read \n");
return(0);
}
Thanx in advance
oam
|
|
|
|
|
This piece of code:
PROCESS_INFORMATION pi;
STARTUPINFO si;
HANDLE hProcess = pi.hProcess;
Seems a bit buggy , you haven't invoked CreateProcess yet, so hProcess is set to whatever is at the memory location pi.hProcess.
Why is there two calls to ReadProcessMemory ?
When you've invoked ReadProcessMemory, the second invocation , you could call GetLastError to let Windows tell you what went wrong. At the moment I guess it would say that hProcess is an invalid parameter
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
CreateProcess has been invoked, the missing part was the
BOOL EnableDebugPrivNT(); which enables access to the specified memory.The ReadProcessMemory has been removed now. About pi.process i thought the created process will be the one to readmemory of...
oam
|
|
|
|
|
mpapeo wrote:
About pi.process i thought the created process will be the one to readmemory of...
You tell me
What is wrong in the code though, is that you declare the variable pi , which is to be filled by the function CreateProcess . However, before actually filling that struct, you assign the value of one of it's members to the variable hProcess .
I don't know about the rest of the code, but you have to switch the steps here from:
PROCESS_INFORMATION pi;
HANDLE hProcess = pi.hProcess;
to
PROCESS_INFORMATION pi;
HANDLE hProcess = NULL
...
CreateProcess(NULL,
"numbers.exe",
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi
);
hProcess = pi.hProcess;
That is of course assuming that CreateProcess succeeded. There is, in my opinion, a lack of result testing. This is of course essential to production code, but also when you are in a test phase, it would help you a lot in finding the errors.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Well, you have the idea but now i found it crushing.
i get this error, " The value of the ESP was not properly saved accross a function call ...
Well how can i call the ReadProcessMemory to return the size of memory the "CreateProcess()" has occupied as that i can extract it?
oam
|
|
|
|
|
Tis a simple question and can be answered easily in QuickBasic but how can I do it in a C++ 6.0 console app? I'm taking a 1st semester C++ class and my instructor can't answer my question. The book doesn't cover it and I have looked but can't find it on the web -- not sure I know how to ask the question correctly. I'm looking for a standard C++ string function which does something like:
mystring = StringFcn(n,"ch")
where n = number of characters to be put in the string
and ch = the character to be used.
Given n = 5 and ch = x
cout << mystring << endl; would produce
xxxxx
I can brute force it, but would expect there to be a standard library function.
thanks for any help.
jj2
|
|
|
|
|
|
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n=5;
char ch='x';
string str(n,ch);
cout<
|
|
|
|
|
/*
Hi Duds,
I am using IFileSystem Interface from scrrun.dll.
It is easier to use "Scripting.FileSystemObject" in Visual Basic.
However, when srcrun.dll is imported so as to used in VC++ project is gives following
compilation error.
warning C4003: not enough actual parameters for macro 'GetFreeSpace'
GetFreeSpace falls under category of Obsolete Windows Programming Elements.
These functions are supported only for backward compatibility with the 16-bit Windows API.
To get rid of this problem, you need to undefine GetFreeSpace as #undef GetFreeSpace.
Now code starts compling properly.
Real Problem with this interface is:
void CopyFolder(
[in] BSTR Source,
[in] BSTR Destination,
[in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
When folder already exists CopyFolder API throws exception, even when passing
OverWriteFiles=FALSE.
My objetive is if the destination folder already exists, then copy folder should copy files
that are not present in the destination folder.
So, How to copy file to folder which might already exists?
Thanks & regards,
Rajesh
nikam_rajesh@hotmail.com
*/
#include <atlbase.h>
#undef GetFreeSpace // For warning C4003: not enough actual parameters for macro 'GetFreeSpace'
#import "scrrun.dll"
using namespace Scripting ;
int MyCopyFolder (char *szSrcPath, char *szDstPath)
{
CoInitialize (NULL) ;
try
{
IFileSystemPtr ifSysPtr ;
ifSysPtr.CreateInstance (__uuidof (FileSystemObject)) ;
ifSysPtr->CopyFolder (szSrcPath, szDstPath, FALSE) ;
}
catch (_com_error e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
MessageBox (0, (char *)bstrSource, (char *)bstrDescription, MB_ICONINFORMATION) ;
}
catch (...)
{
MessageBox (0, "Error occured while copying file.", "Copy Folder Demo", 0) ;
}
CoUninitialize ();
return 1 ;
}
int main ()
{
int nRet = MyCopyFolder ("c:\\test", "c:\\test1") ;
return 0 ;
}
Rajesh Nikam
|
|
|
|
|
:-DQuestion one:
What is the meaning when window is actived?
What is the difference between actived and setfocus?
What operation will make a object of CWnd class responds the OnActivate message?
Questiong two:
There is a class named CBMWin which derived from CWnd.I generate its objects by dynamic, and display them in the View of a MDI application as the view's subwindows.Now, I need to chage those subwindows' style by those subwindows's state. For example, when I select a subwindow, the style of the subwindow should add a WS_SIZEBOX style and previous subwindow I selected should remove the WS_SIZEBOX style.If I hit the client area which does not occupied by those subwindows, all of those subwindows have not a WS_SIZEBOX style .In a word,the selected subwindow havs a WS_SIZEBOX style and other have not.
Which message of the CBMWin class Should I deal with?
Looking forward to your help!
andy
|
|
|
|
|
Question three:
How will you learn anything if you get someone else to do your homework?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I think if you can tell me the answer, I will learn how to resolve the similar problem.Thank you all the same,ravi.
andy
|
|
|
|
|
Hi all,
I am learning how to develop adding for devstudio.
have developed one with two buttons.
I want to change the name of toolbar when addin is loaded.
When i load addin .. by customize, going to that path and toolbar comes up.
The default name of toolbar that is coming is "toolbar1".
How I can change this name to (say "My1stAddinTB") programmatically?
I know i can rename toolbar1 from customize option in context menu.
i have looked some samples from CP but all those addin has same characteristic... giving toolbar1,2 and so on
Is it possible to give some useful name to toolbar from addin. Like the one already in VC IDE... (e.g. "Wizard","Debug" )
Thanks in advance
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
Hi. I got an animation on an MDI app and i want to insert sound with it. I looked on the web and the only thing i found is the FMOD library but when i inserted it into my application, it doesn't work. Does any one knows how to do it without/with FMOD or can i get an appropriate source code which uses sound with an MDI?
Get busy living or get busy dying!
|
|
|
|
|
Are you referring to the sndPlaySound() or PlaySound() functions? There's also a suite of MCI (multimedia) functions.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i am into making a dialog based application.....i have defined static controlz(i have given it propertiez by subclassing....hence modifing it)....what i need to know is that.....i would want to be able to recieve a message in the control when a left button of the mouse goes up OUTSIDE THE CONTROL.....i have used OnNcLButtonUp()....but that doesnt help....can u tell me why???.....doesnt OnNcLButtonUp mean to sense left button up outside the client area????.....
if it is not iz there any other way whereby which i could sense thiz??...
i am sure thiz OnNcLButtonUp message doesnt go to the control since i verified it(by putting in a message box command to pop up ,if thiz function getz triggered!!!)....
sob!!!!!.....any ideaz.....?????
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I think you'll have to capture the mouse in the control when you receive a WM_LBUTTONDOWN, then I'm pretty sure you'll get the WM_LBUTTONUP message regardless of where the mouse cursor is when the button is released. But I've never used mouse capture myself, so I can't really give any good advice. Look into SetCapture in MSDN.
WM_NCLBUTTONUP is send when the mouse button is released in the windows' non-client area, i.e. title bar, menu bar, border etc. A static control has no non-client area (the client area completely fills the window area) so you won't receive any WM_NC* messages. I think you misunderstood the concept of non-client area, it's the part of the window area (for the control/window) that's not client area.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|