|
Moving the code over from Borland? It's been a really really long time since I had to manipulate the cursor position of the console, so I can't remember if there's any C++ standard stuff to do it, but in Win32, you can use SetConsoleCursorPosition, which the C++ routine would probably call anyways.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Not actually moving, i just dont have a Borlang compiler right now and i was wondering if i can compile my code using Microsoft Visual C++ 6.0. Well ok let me try replacing the gotoxy with the SetConsoleCursorPosition, Thanks Chris! I really appreciate your help
Thanks/Regards
Sidney
|
|
|
|
|
No problem , I hope it works for ya!
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Hi,
Quick question that is probably easy to implement.
I have an MFC Grid control as part of a dialog application. Problem is once it has focus, the user cannot tab-key out of it.
What needs to be done to enable this?
Some example code would be very much appreciated.
Thanks,
-Chris
|
|
|
|
|
Here's what I came up with for the above problem. Is there a more efficient or nicer way to solve this problem?
typedef struct _List
{
int data;
_List* pNext;
_List(int d) : data(d), pNext(0) {}
} List;
int main(int argc, char* argv[])
{
List* pList = new List(0);
List* pTemp = pList;
for (int i = 1; i < 10; i++)
{
pTemp->pNext = new List(i);
pTemp = pTemp->pNext;
}
pTemp = pList;
while (pTemp)
{
DEBUGF("%i", pTemp->data);
pTemp = pTemp->pNext;
}
DEBUGF("reversing...");
List* p1 = pList;
List* p2 = pList->pNext;
p1->pNext = 0;
while (p2)
{
List* p3 = p2->pNext;
p2->pNext = p1;
p1 = p2;
p2 = p3;
}
pList = p1;
pTemp = pList;
while (pTemp)
{
DEBUGF("%i", pTemp->data);
pTemp = pTemp->pNext;
}
return 0;
}
Todd Smith
|
|
|
|
|
Looks good to me. It executes in O(n) so it will be hard to beat.
Then again, I could be wrong.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hy everybody!
how are you?
I have a litle doubt...
Does have any way to use a Dialog (or something like this) from a DLL into an FormView (inside a SplitterWnd)?
thanks all,
c'ya!
-=Ricky=-
|
|
|
|
|
How could I manage a app according with the user profile logged in a Server Operational System ??
I need functions to get the current profile name and get the directories of all user profiles.
Thanks,
Cris.
|
|
|
|
|
Hi!
I have derived my own class from CAsyncSocket and defined OnReceive/OnSend/On...() -Handlers for any possible events, e.g. like that:
void CUDPSocket::OnReceive(int nErrorCode)
{
if (nErrorCode == 0)
((CServerQueryDlg*)m_pWnd)->OnReceiveUDP();
}
Now I want to put this derived class into a DLL to use it easily in any other application. But I don't know how to make it flexible so that any CWnd -derived class will be accepted in the DLL and not only CServerQueryDlg . Since when I don't cast the call to OnReceiveUDP the compiler can't find the function in my CWnd -based app.
Any suggestions how to make this code flexible?
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello,
When I build my MFC project at warning level 4 using VS6sp5, the compiler generates a ton of warning messages from the locale files xlocale and xlocnum. Is this a normal occurance ? I don't want to see these warnings every time I do a rebuild, so how can build my own project files at warning level 4 but outside includes at level 3 ? Or is there a better solution ?
An example of the compiler messages I receive is shown below.
Thank You
srs
c:\program files\microsoft visual studio\vc98\include\xlocnum(599) : warning C4018: '<' : signed/unsigned mismatch
c:\program files\microsoft visual studio\vc98\include\xlocnum(588) : while compiling class-template member function 'class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > __cdecl std::num_put<unsigned short,
class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::_Iput(class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> >,class std::ios_base &,unsigned short,char *,unsigned int)'
c:\program files\microsoft visual studio\vc98\include\xlocnum(606) : warning C4018: '<=' : signed/unsigned mismatch
c:\program files\microsoft visual studio\vc98\include\xlocnum(588) : while compiling class-template member function 'class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > __cdecl std::num_put<unsigned short,
class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::_Iput(class std::ostreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> >,class std::ios_base &,unsigned short,char *,unsigned int)'
c:\program files\microsoft visual studio\vc98\include\xlocale(204) : warning C4244: '=' : conversion from 'unsigned int' to 'char', possible loss of data
c:\program files\microsoft visual studio\vc98\include\xlocnum(151) : see reference to function template instantiation 'int __cdecl std::_Getloctxt(class std::istreambuf_iterator<char,struct std::char_traits<char> > &,class std::istreambuf_it
erator<char,struct std::char_traits<char> > &,unsigned int,const char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocale(207) : warning C4244: '=' : conversion from 'unsigned int' to 'char', possible loss of data
c:\program files\microsoft visual studio\vc98\include\xlocnum(151) : see reference to function template instantiation 'int __cdecl std::_Getloctxt(class std::istreambuf_iterator<char,struct std::char_traits<char> > &,class std::istreambuf_it
erator<char,struct std::char_traits<char> > &,unsigned int,const char *)' being compiled
|
|
|
|
|
Fixed.
My solution to this problem was to change the global warning level before including the headers that used the locale files, like so :
#pragma warning(push, 3)
#if !defined(_BITSET_)
# include <bitset>
#endif // !defined(_BITSET_)
#pragma warning(pop)
|
|
|
|
|
I need a xml filter for Indexing services. There are any chances to find one that is working ?
Do you have experience (positive / or ..) using this filter ?
Thanks a loot .
|
|
|
|
|
Is there a way to automatically zoom the CDC of a window?
ScaleViewportExt sounded like that, but didn't seem to do anything at all :/
|
|
|
|
|
here's a quick and dirty way to do it..
put this at the top of your OnDraw/OnPaint
int lpx = pDC->GetDeviceCaps(LOGPIXELSX);
int lpy = pDC->GetDeviceCaps(LOGPIXELSY);
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(CSize(lpx * (100.0 / (double)m_fZoomPct) , lpy * (100.0 / (double)m_fZoomPct)));
pDC->SetViewportExt(lpx, lpy);
-c
Please stand by
|
|
|
|
|
how i can make dll send message to application
salah
gis member
|
|
|
|
|
I have a problem opening a socket.
I have tried this way but it do not create the socket.
CSocket* pSocket;
pSocket = new CSocket;
pSocket->Create();
pSocket->Connect("212.5.133.1",80);
What am I wrong?
Trin2
|
|
|
|
|
I tend not to use CSocket for winsock work, so this might not be right, but I quick look in MSDN suggest's you have your parameter's wrong for Connect(). Does this even compile?
BOOL Create( UINT nSocketPort = 0, int nSocketType = SOCK_STREAM, LPCTSTR lpszSocketAddress = NULL );
Dylan
"In meetings, the person who is least competent usually does the most talking. Talking is a direct substitute for competence, at least in the minds of other people. Five minutes after you leave a meeting, you won't remember what anyone said but you will remember who did most of the talking. Withing a day your mind will translate that into a notion that the talker was unusually knowledgeable" - Scott Adams, Dilbert and the way of the weasel
|
|
|
|
|
see CreateProcess
or
SHELLEXECUTEINFO info;
memset( &info, 0, sizeof info );
info.cbSize = sizeof info;
info.fMask = SEE_MASK_NOCLOSEPROCESS;
info.lpVerb = "open";
info.lpFile = "urExe.exe";
info.nShow = SW_SHOWNORMAL;
ShellExecuteEx( &info );
WaitForInputIdle( info.hProcess, INFINITE );
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I've finished a socket application and am trying to
build the core part of the application into a DLL. the "core part" includes CMySocket class derived from CAsyncSocket, and some other helper classes.
CMySocket stores a pointer to a CMainFrame object, which has proper functions that handle events occuring on the socket.
The main purpose of writing this DLL is to make the
CMySocket class easy to be reused for future applications.
I want to define the handler function prototypes that the
future applications would follow. I don't want to restrict the pointer to a CMainFrame object, rather it can be
pointing to any CWnd-like object, which would allow more flexibility.
My question is: since CMySocket needs a pointer to a CWnd
to call proper handlers when events occuer, how can I get rid of the implementation of the functions and hence the CWnd-like class? (I don't think deriving a class from CWnd
is a good idea; if so, that means the applications need to derived another new class from that one. Is it?)
This is the first i ever try to build a DLL. Any hint is strongely welcome.
(btw, the DLL would be an MFC extention DLL)
Thank you so much!
Wenrich
|
|
|
|
|
I am developing an TAPI application. I made dial by using lineMakeCall fn. It works fine. But my requirement is to dial '705', after ringing tone arrives i have to press destination number. How it could be possible.
Please help me.
|
|
|
|
|
Do you mean the dial tone, you can't dial numbers whilst a phone line is ringing. Or did you mean when the phone is answered.
Have a look at the LINE_CALLSTATE messages, especially LINECALLSTATE_DIALTONE and LINECALLSTATE_CONNECTED.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I am writing a C Dll which the user wants to be able to modify the source of and recompile himself. However they dont want to install VC, which is what I am using to create the dll. I looked into the GCCC compiler but got lost because it seems you have to build the source etc and configure it. Does anyone know of a simple free compiler that I can download, which just compiles the dll? The dll has a .c file and a .def file.
If the gccc compiler is really not that complicated, perhaps you can simplify the concept and give me a quick outline about it?
Appreciate your help,
ns
|
|
|
|
|
Cygwin is a UNIX environment for Windows and comes with gcc pre-built. There's also a compiler called DJGPP although I've never used it.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
though there are bound to be lots of difficulties trying to get code written for VC to compile with gcc
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Its a very straightforward C dll which does averaging and similiar number crunching with a signature of MyDll(int* a, int*b).....
Hopefully gcc can handle that...?
Anyways I still need to find out how to get a dll out of my .def file and my .c file.....
Thanks!
Appreciate your help,
ns
|
|
|
|