|
Need some information or websites about how to send an SMS using visual c++ 6;P
nolan
|
|
|
|
|
There are two ways to send SMS :
1.You can connenct to the SMSC (SMS Center of your mobile operator) over the internet, and send message through it. This of course requires an internet connection as well as an account with your operator but it does not require a mobile phone.
An implementation:
http://www.codeproject.com/useritems/smpplib.asp
2.Your PC communicates directly with the phone over serial port, IrDA or Bluetooth, either in text or (which is more common) PDU mode
A goog starting point for the theory:
http://www.dreamfabric.com/sms/
Bunburry
|
|
|
|
|
Thank you so much for your help,I''ll try and get on to SMSC and will let you know how it goes,
thanks;)
nolan
|
|
|
|
|
i tried to create a button by declaring a CButton object in the CView::OnCreate message in my MFC SDI Application , but what i'v noticed that the button won't be created untill i declare the CButton object in the Class Declaration, thats weird ! why i can't declare and create the button in the class definition !?
thanx
|
|
|
|
|
Because of the way MFC works:
1. Construct an object you desire in the application. This can be anything from CButton to CPen, a CEdit or a CListBox, no matter. You can construct it statically (adding a static member to your parent class definition) or dynamically (by using a static pointer with the 'new' operation)
2. When the object is constructed, call it's 'Create' member method to create the underlying Windows object, and bind it to this MFC object.
3. When you no longer need the Windows object, call 'DeleteObject' to destroy it.
4. When you no longer need the MFC object, either let it pass out of scope so it's destructor is called (static members) or call 'delete' to release dynamically reserved memory.
Now, as for the code analysis you posted:
You created a CButton static object in the CView::OnCreate handler. This means that the MFC object is constructed. If you call the 'Create' member function, the underlying Windows object is created as well. When the handler call ends, the CButton destructor gets called, and it's existence straightforwardly ends.
You should go to the local library and pick up an MFC programming book. Knowledge in Windows programming also helps. This book would be able to clarify the functionality of MFC to you in detail, so you can get a better grasp of what it actually is and how it is used.
CodeProject sports a collection of good articles as well:
-Nishant S.'s excellent 'MFC under the hood' article http://www.codeproject.com/cpp/mfcprogflow.asp[^].
-Mehdi Mousavi 'Win32 vs MFC, part I' http://www.codeproject.com/cpp/mfc_architecture.asp[^].
-Joseph M. Newcomer with 'Attaching and Detaching objects' http://www.codeproject.com/cpp/attachdetachobj.asp[^].
You can find more from the 'General' and 'Beginners' sections of General -> C++/MFC area. Happy browsing
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
Hi, i'm making a class that has all static functions and variables in it. When i first made a few private static variables it gave me a linker error about unresolved externals. But then i found that if you initialized the values in your .cpp file then it didn't give those errors. But one of the variables i'm declaring is an array of a struct which is also declared as private in my class. But now my problem is, how do i initialize the array? i mean, i can't just initialize the array to NULL because well.. the types don't match. Here's an example:
.h file:
class blablabla
{
private:
struct somestruct
{
int int1;
int int2;
}
static somestruct myarray[10];
static int someint;
public:
}
.cpp file:
blablabla::someint = 0;
blablabla::myarray = ???
Kuniva
--------------------------------------------
|
|
|
|
|
This initializes the array to be filled with zeros.
blablabla::somestruct blablabla::myarray[10] = { };
- Mike
|
|
|
|
|
thanks! you forgot the 0 between the { and } though cause it wouldnt work at first
|
|
|
|
|
Woops, now i have another problem
You see the thing i'm trying to compile is a DLL. A layered service provider to be exact (not that i think it matters much). But to compile it i always used the makefile, because when i made a workspace for it in VC it would compile, but it just wouldnt work right. So now i have my class with all the static functions and variables in the DLL project. But now when i try to compile with the makefile it gives me another linker error. An unresolved external for a public function from my class. I don't know much (or anything) about makefiles, just that they give options to the compiler and linker or something so i can't really understand why it doesnt work. My guess would be that when i compile it in VC it has other options set or something, so it will compile but the result will be a DLL that doesnt work right. Here is the makefile:
!include <win32.mak>
!IFNDEF NODEBUG
.cpp.obj:
$(cc) $(cdebug) $(cflags) $(cvarsdll) -DSTRICT -YX\
/D "DEBUG_TRACING"\
/D "TRACING" /Od /D "_DEBUG" $<
!else
.cpp.obj:
$(cc) $(cdebug) $(cflags) $(cvarsdll) -DSTRICT -YX -DNODEBUG $<
!endif
CPP_FILES= dbuffmgr.cpp\
doverlap.cpp\
dasyncw.cpp\
dworker.cpp\
dcatalog.cpp\
dcatitem.cpp\
dllmain.cpp\
dprovide.cpp\
dsocket.cpp\
spi.cpp\
trace.cpp\
dthook.cpp
OBJS= $(CPP_FILES:.cpp=.obj)
all: lsp.dll inst_lsp.exe
lsp.dll: $(OBJS)
$(link) $(linkdebug) $(dlllflags) \
-map \
-export:WSPStartup \
-out:$*.dll $(OBJS) $(guilibsdll) ws2_32.lib
inst_lsp.obj: inst_lsp.cpp
$(cc) $(cdebug) $(cflags) $(cvars) inst_lsp.cpp
inst_lsp.exe: inst_lsp.obj
$(link) $(linkdebug) $(conlflags) -out:$*.exe inst_lsp.obj\
rpcrt4.lib $(conlibs) ws2_32.lib sporder.lib
clean:
-del *.obj
-del *.dll
-del *.pch
-del *.exp
-del lsp.lib
It creates two things basically, an .exe and a .dll. It also exports the WSPStartup function so windows can access it. But as i said i get an unresolved external linker error on the static public function of my class since i added my class.
P.S.: I try to call this function from some global function in the DLL like:
CMyStaticClass::MyFunction(someparameters);
Kuniva
--------------------------------------------
|
|
|
|
|
hi,
i need a control to show a message near the system tray. It should be in win32 (no MFC please). My app runs in the system tray, and needs to show a message (like 'you've got mail').
please point me to any good source code. i cant find any.
Regards,
HariKrishnan
Hari Krishnan
|
|
|
|
|
Go check the MSDN section called 'Using ToolTip controls'. ToolTips are small messages displayed to the user. Their general use is to pop up when you hover the mouse over an icon. However, even the 'Click here to stay current with automatic updates' tooltip bound to the Windows Update System tray icon is just a standard tooltip, with some extra styles applied.
The article is a good place to start. Unfortunately I cannot provide you with a ready code.
Here is a link to it: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/usingtooltips.asp[^].
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
THanks to both of you guys
Hari Krishnan
|
|
|
|
|
I don't understand why "copyLine(ifstream& fins, ofstream& fout)"?
Why copyLine function has to be passed by reference. The first
code is presented in textbook as an example, however, it doesn't
explain why copyLine must pass by reference. The second is rewritten
by me in attempting to use another apporach.(the apporach that does
not need to pass by reference) But the second one got an unresolved
fatal link error.
It is not that I don't like passing by reference, it is just that I don't
understand why they are passing by reference. Do streams always
have to be passed by reference?
<br />
void FileCopy()<br />
{<br />
ifstream fin;<br />
ofstream fout;<br />
<br />
string inFile;<br />
cout << "Please enter the input file name or path: ";<br />
cin >> inFile;<br />
fin.open(inFile.c_str());<br />
<br />
string outFile;<br />
cout << "Please enter the destination file name or path: ";<br />
cin >> outFile;<br />
fout.open(outFile.c_str());<br />
<br />
if(fin.fail())<br />
{<br />
cerr << "error: cannot open " << inFile <br />
<< " for input." << endl;<br />
}<br />
<br />
int lineCount = 0;<br />
while(!fin.eof())<br />
{<br />
if (copyLine(fin, fout) != 0);<br />
lineCount++;<br />
}<br />
<br />
cout << "Input file copied to output file." << endl;<br />
cout << lineCount << " lines copied." << endl;<br />
<br />
<br />
}<br />
<br />
<br />
<br />
int copyLine(ifstream& fin,<br />
ofstream& fout)<br />
{<br />
const char NWLN = '\n';<br />
char nextCh;<br />
int charCount = 0;<br />
<br />
fin.get(nextCh);<br />
while((nextCh != NWLN) && !fin.eof())<br />
{<br />
fout.put(nextCh);<br />
charCount++;<br />
fin.get(nextCh);<br />
}<br />
<br />
if(!fin.eof())<br />
{<br />
fout.put(NWLN);<br />
charCount++;<br />
}<br />
<br />
return charCount;<br />
}<br />
<br />
int main()<br />
{<br />
string inFile;<br />
cout << "Please enter the input file name or path: ";<br />
cin >> inFile;<br />
<br />
string outFile;<br />
cout << "Please enter the destination file name or path: ";<br />
cin >> outFile;<br />
<br />
copyLine(inFile, outFile);<br />
<br />
return 0;<br />
}<br />
<br />
<br />
void FileCopy(string inFile, string outFile)<br />
{<br />
ifstream ins;<br />
ofstream outs;<br />
<br />
ins.open(inFile.c_str()); <br />
if(ins.fail())<br />
{<br />
cerr << "error: cannot open " << inFile <br />
<< " for input." << endl;<br />
}<br />
<br />
outs.open(outFile.c_str());<br />
if(outs.fail())<br />
{<br />
cerr << "error: cannot open " << inFile <br />
<< " for input." << endl;<br />
}<br />
<br />
while(!ins.eof())<br />
{<br />
const char NWLN = '\n';<br />
char nextCh;<br />
<br />
ins.get(nextCh);<br />
while((nextCh != NWLN) && !ins.eof())<br />
{<br />
outs.put(nextCh);<br />
ins.get(nextCh);<br />
}<br />
<br />
if(!ins.eof())<br />
{<br />
outs.put(NWLN);<br />
}<br />
}<br />
<br />
}<br />
|
|
|
|
|
Passing by reference ensures that the stream objects aren't copied. When dealing with streams this is extremely important. You can think of the iostream library as very smart wrappers for handles.
The constructor initialises the handle, and the destructor frees it.
If you copy a stream you get a copy of the handle, but you will end up trying to free the handle twice, once at the end of the local block and once at program shutdown.
As a rule of thumb:
For input only paramters
1/ pass by const reference (objects or anything expensive to copy)
2/ pass by value (primitive types)
For output or input/output parameters
1/ pass by reference
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
In 6.0 "#using" is not a valid command. I want to do this:
#using <msimg32.lib> but it won't let me. How do you say that in 6.0?
LOSTTWARE.com
|
|
|
|
|
#pragma comment( lib, "msimg32.lib" )
This embeds a command to the linker in the object file generated by the compiler for this source file. MFC uses comment pragmas to force linking to the appropriate MFC runtime library files depending on your definitions.
The #using directive is for importing a managed library for use in managed C++ code.
|
|
|
|
|
Hi there,
I am using pattern brush to fill a rectangle. The Pattern is displayed perfectly but when I print it, the pattern becomes so small that any one could hardly figure it out. This is because higher the printer resolution, higher the density of pattern per inch. So I need a way to change or decrease the printer Resolution or the DPIs at run time. Can anyone help me out?
Regards,
Tejas
|
|
|
|
|
Hi,
has anyone an idea who to loop through all Outlook Folder (the default Folders and the folders who has someone created) and
save the data for example in a text file.
To save it in file is not the problem;
but how can I "automatically" loop through all outlook Folders ?
You know, I´m using C++ and the wrapper classes from the outlook typ libraries.
Thanks a lot !
|
|
|
|
|
Hi,
has anyone an idea who to loop through all Outlook Folder (the default Folders and the folders who has someone created) and
save the data for example in a text file.
To save it in file is not the problem;
but how can I "automatically" loop through all outlook Folders ?
You know, I´m using C++ and the wrapper classes from the outlook typ libraries.
Thanks a lot -1
|
|
|
|
|
In the Outlook object model folders and subfolders can be accessed through:
Outlook::MAPIFolder - represents a folder or a subfolder under which messages exist
Outlook::_Folders - represents a collection of such MAPIFolders.
You can get the toplevel collection of Folders from the Namespace object like:
<br />
<br />
CComPtr< Outlook::_NameSpace > spNamespace; <br />
spNamespace = spApp->GetNamespace(OLESTR("MAPI")); <br />
ATLASSERT(spNamespace!=NULL);<br />
<br />
<br />
CComPtr< Outlook::MAPIFolder > spFolder;<br />
CComPtr< Outlook::_Folders > spFolders;<br />
<br />
HRESULT hr = spNamespace->get_Folders(&spFolders);<br />
if(FAILED(hr))<br />
return hr;<br />
<br />
long nb_items = -1;<br />
spFolders->get_Count(&nb_items);<br />
<br />
<br />
for(int l=1;l<=nb_items;l++)<br />
{<br />
spFolder = spFolders->Item(CComVariant(l)); <br />
ATLASSERT(spFolder);<br />
<br />
CComBSTR bstrFolderName;<br />
hr = spFolder->get_Name(&bstrFolderName);<br />
if(FAILED(hr))<br />
break;<br />
<br />
ATLTRACE(bstrFolderName);<br />
_FoldersPtr subFolders;<br />
hr = spFolder->get_Folders(&subFolders);<br />
hr = EnumerateSubFolders(subFolders);<br />
<br />
}<br />
<br />
for instance to get to my Outlook Inbox, I have to drill down the object model such:
Personal Folders
|Inbox
|Outbox
|Calender
|Drafts
|other folders
Other .pst file
|Chapter1
|Chapter2
IMAP account
|Inbox
etc etc.
HTH,
amit.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
Hi
I can create folders and delete them by using namespcae MAPI. But it not allows to create data files (Personal folders).
Do you know how Can I create Personal folders. Or if it is not supported do you know how data is written in .pst files ?
Thank You .
|
|
|
|
|
How can i user IAMAnalogVideoDecoder to Set Different Analog Video Standards
Such as PAL_B,PAL_D,PAL_H,PAL_I,PAL_M ,SECAM_B ,SECAM_D ,SECAM_K .
I have developed a video capture module , it successfully picks the Video From a USB cam
.But When i pick TV_TUNER card camera , It does give good quality video.
When i set Video Standards(PAL-B) through some other softwares , it starts working Fine.
plz help specially me with an example
Thanks
No Worries!
|
|
|
|
|
hi,
i using crystal report 6.0 for my project. i don't know what are the fiels needed to redistribute the crstal report with my application package. i take setup for the project using package & deployment of visual studioi .net. any one help to me. how to do this.
thanks in advance.
Murali.M
|
|
|
|