|
You can find some shareware and commercial SMS libraries here.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hi,
i am new to vc++,i am trying to add two dates but i could not get it.can anyone help me in solving this?i want to add two dates and store it in a variable (of any type), like datediff in vb do we have any such functions in vc++?
thanks in advance for all
|
|
|
|
|
See the CTimeSpan class. There are also a bunch of articles right here at CP!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I have programmed a MFC application under Win XP, and now i try to run my app on Win98.
I have copied the following files to the win98 system dir:
MFC42.dll, msvcp60.dll, msvcrt.dll
I get the following error:
The MSVCRT.DLL file is linked to missing export NTDLL.DLL RtlGetNtVersionNumbers
With Dependency Walker i see that the version of ntdll.dll not correct is for my app. When i copy a newer version of ntdll.dll to the system dir, windows doesnt start correctly.
Thanks for helping me!
Willem
|
|
|
|
|
I think I had a problem like yours with windows nt a couple of years ago and after several attempts I realized that there was no way around it (for me at least). My assumption was that ntdll.dll for windows 9x is not compatible with windows nt's. I hope someone has a solution for your question.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I'm doing a project where i have to keep reading a struct from the disk and i have to keep doing this until i come to a special set of bits. I don't know how many structs are on the disk so i need to be able to do something like this:
unsigned int num_structs = 0;
struct_name *the_struct;
do
{
num_structs++;
the_struct = realloc(sizeof(the_struct)*num_structs);
read_struct(&the_struct[num_structs-1]);
} while (nextbits() == 'whatever')
Where the function realloc will preserve the data already written in the memory area. Is this possible?
thanks!
|
|
|
|
|
No. But you can do this:
unsigned int size;
int* array;
for( int i = 0;i < 10;i++ )
{
int* temp = array;
size++;
array = new int[size];
memcpy( array, temp, sizeof(int) * (size-1) );
delete[] temp;
}
|
|
|
|
|
have a look on std::vector
http://www.msoe.edu/eecs/ce/courseinfo/stl/vector.htm
|
|
|
|
|
I want my server to be password protected. I use asynchronous I/O with WSAAsyncSelect() and wondering a few things.
In FD_ACCEPT: I should not do handshaking here because it would block other clients from connecting to the server if the handshaking client doesn't send data fast. Am I right here?
In FD_READ: If handshaking is made here, than every time FD_READ is sent I must check if the client is handshaking or not. Is this right place to check whether the client is handshaking or not?
Hope you understand me!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi Rickard, here a copy from our mail conversation:
I think this is rather a protocol question than a networking question. I would do something like a handshake between server and client... e.g. (each \n is a newline character):
client: ricksprotocol_01\n<br />
server: OK\n<br />
client: connect user rick pass supersecret\n<br />
server: OK\n
I do it like that: when a client connects it becomes accepted and a flag showing it state is set to CLIENT_HANDSHAKE. Now server and client send and receive text lines for handshake. After the client has identified the flag is set to CLIENT_RICKCHAT (or to CLIENT_TELNET if it's not a true chat client or whatever).
enum {
CLIENT_DEAD = 0,
CLIENT_HANDSHAKE,
CLIENT_TELNET,
CLIENT_RICKCHAT,
};
Hope it helps....... Moak
|
|
|
|
|
And to get to know if the client is HANDSHAKING or not I need to check that every FD_READ?
Yes, it must be like that! Don't know any better solution!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
And to get to know if the client is HANDSHAKING or not I need to check that every FD_READ?
yup. If it's not boring for you I can tell you what I do: FD_READ calls a OnReceive() method of my socket. There I collect bytes until I received a full text line (streaming nature of TCP requires this). Each full text line calls OnReceiveLine() method and all protocol stuff is handled. Only here I parse for commands and for example do client-server handshake. When the client has logged in properly a special flag is set.
At this point, when you work object orientated, you could swap socket object (assign socket handle to a new object)... and the new OnReceiveLine() method would not need to further check if handshake has to be done. It's pretty handy if you have different sockets with totaly different tasks. So you avoid gazillions of checks and state variables and complicate all-purpose-code.
However, I do a text based handshake in my code b/c it's more flexible for my needs. Of course you can work with binary codes if you don't like text parsing.
|
|
|
|
|
Moak wrote:
At this point, when you work object orientated
I wish my server could be 100 % C++ but it's not!
I use many globals and many functions. As for now... I only has 2 classes for handling two log books.
But this is just a test server.. pretty big to be a test server but what the heck!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi:
As you know EditBoxes have its own ContexMenu that apper when you right
click on them,now is it possible to add some items to this menu ? for example i think it is nice to be able to add "Help..." or "About..." items to it.please help me.
Excuse me for bad comments.
Best Regards.
|
|
|
|
|
|
For some time now, I've been writing components for performing various operations all without presenting a user interface, and letting VB do the UI stuff for me.
I've now got to the point, where it's just getting to damn hard to keep track of all the threads my components create and synchronising them back to VB.
I'd like to move my App to VC/MFC (vc6), and do away with the components as such, but I'm just unsure about how to progress.
I've basically built an app which has 8 concurrent(worker threads afaik), that presents various stages of progress for a configuration application
1 parent window with 8 vb frame windows inside it. How do I do this in MFC.. I really don't like the idea of throwing up 8 individual windows.
Please help, I know this sounds pretty lame, but I'm ready to take the next step regarding my application development.
|
|
|
|
|
Hi!
I am writting a program which has several threads and each thread must run only on one CPU.
My questions are:
1. SetThreadAffinityMask can only thread on those CPU which its process is allowed to run, Can I use this code
SetProcessAffinityMask(GetCurrentProcess(),0xFFFF);
to access all the CPUs(Note: that the affinitiy mask is 1 for all CPUs). Does this code run on all systems without error even on single processor systems?
2. Can I use
SetThreadAffinityMask(GetCurrentThread(),3);
to run the thread on both CPU0 & CPU1? or does it give the choice for thread to run on any of them? or should I set only one vector bit to high?
It is a bit confusing for me , anyone can elaborate on this topic? It can be very useful since many new systems are comping with HT or mulitprocessor.
Thanks!
Rob
|
|
|
|
|
I've got VC++ .NET solution with more than 3 projects. I'd like to add another (proved as working) project, which mainly producing strings (stimulated by an external hardware equipment connected to com1). Let's call the added hardware project as "Har" and to existing DLG project to whom I'd like to transfer the strings as "MDlg".
My problem is to "transfer" generated strings from Har to MDlg in the solution scope. In the project scope I have no problem to do that by:
1) Declare in one cpp file a string variable and declare it in other cpp files as extern, works - no problem.
2) Define base class with static string variable and inherit other relevant cpp files from this base class, works - no problem.
Problem is that above 2 technics aren't working in the solution scope and generating link errors .
How can I solve the problem (please don't suggest me to incorporate Har into MDlg, not in my lifetime )
|
|
|
|
|
|
I have a com dll written in C++ which is used in asp applications. The dll contains only one com object. There are static (global to the process) data objects within this dll. Obviously, I only want to initialize these static objects when the dll is first loaded.
However, IIS seems to be reloading my dll everytime the com object is created and used in an asp page.
P.S. Already tried the trick of returning S_FALSE in DllCanUnloadNow, doesn't really work. For VB6 com dll, you can set a project property "Retained in memory" which is exactly what I need. Don't know if the same can be done with VC++ com dll.
|
|
|
|
|
Anonymously wrote:
I have a com dll written in C++ which is used in asp applications. The dll contains only one com object. There are static (global to the process) data objects within this dll. Obviously, I only want to initialize these static objects when the dll is first loaded.
However, IIS seems to be reloading my dll everytime the com object is created and used in an asp page.
Try running it inside a COM+ application or MTS package: create a new COM+ Application, drag and drop the dll inside it and in the properties configure the application to never shut down.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
Sorry, COM+ is not allowed for this specific project.
I am just wondering what is exactly the "retained in memory" property of VB6 com dll and why there is no such thing for VC++ com dll.
|
|
|
|
|
This is not a real programming question.
The dialog editor has gone weird and I don't know how to fix it.
The Dialog seems to be a bit too much up left and if I do anything like pull the dialog bottom down everything just disappears. I added a screenshoot here:
http://www.informatik.uni-freiburg.de/~dornhege/ResWeird.gif
So atm I have to set the dialog in the textfile which is not really good
I can't remember changing anything and this applies not to one specific project but to all
Any hints besides reinstall ?
|
|
|
|
|
/*why is it that when i call my msgbox sub-rtn sometimes it will appear behind my dos window and sometimes infront?
here is how i call msgbox.
Libraries used (if related, i don't know; it compiles fine and despite the msgbox problem works fine): stdio.h,stdlib.h,string.h,math.h,conio.h,windows.h,tchar.h
*/
<br />
<br />
HHOOK hMsgBoxHook;<br />
void MsgBoxEnc(void);<br />
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam);<br />
int MsgBoxEx(HWND hwnd, TCHAR *szText, TCHAR *szCaption, UINT uType);<br />
<br />
void main(void){
printf("the stuff printed in my program");<br />
MsgBoxEnc();<br />
MsgBoxEnc();<br />
}
<br />
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
TCHAR ach[40];<br />
HWND hwnd;<br />
HWND hwndButton;<br />
<br />
if(nCode < 0) return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam);<br />
switch(nCode){<br />
case HCBT_ACTIVATE:<br />
hwnd = (HWND)wParam;<br />
SetWindowText(hwnd, _T("Message from Creator"));<br />
hwndButton = GetDlgItem(hwnd, IDOK);<br />
SetWindowText(hwndButton, _T("OK"));<br />
return 0;<br />
}<br />
return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam);<br />
}<br />
<br />
int MsgBoxEx(HWND hwnd, TCHAR *szText, TCHAR *szCaption, UINT uType)<br />
{<br />
int retval;<br />
hMsgBoxHook = SetWindowsHookEx(<br />
WH_CBT,<br />
CBTProc,<br />
NULL,<br />
GetCurrentThreadId() );<br />
<br />
retval = MessageBox(hwnd, szText, szCaption, uType);<br />
UnhookWindowsHookEx(hMsgBoxHook);<br />
return retval;<br />
}<br />
<br />
void MsgBoxEnc(void){<br />
TCHAR szContents[] = _T("File Encoding is now Complete");<br />
TCHAR szTitle[] = _T("File Status");<br />
MsgBoxEx(NULL, szContents, szTitle, MB_OK | MB_ICONEXCLAMATION);<br />
}<br />
/*In my full program i call the function twice in some sub-rtn and the first time the msgbox will appear behind the dos window; second time, in front!? souldn't the same thing happen both times (which would be worse, i want the box to always be infront)??
Also please remember that i kind of have no idea what's going on(i've never used the windows functions in my programming class, gota love 1st yr Engineering). Mostly the problem is i don't understand the different datatypes used here (nor could i find any info on JUST these datatypes on the net); so this is a collaberation of:
code i found on the net,
code i figured out by searching the STD libraries,
and luck.
p.s. if someone could tell me where to learn EXACTLY what happens here, i would be really grateful. thanks for your time.*/
|
|
|
|
|
;PHi, Maximilien. I'm hkbeckham. Could I have your email addres? So, I can send my present program to you.
My email is:
hkbeckham2003@yahoo.com
Cheers
hkbeckham
|
|
|
|