|
If you are comfortable with DIBs, use (for instance) Chris Maunder's DIBSection wrapper for Win32 and WinCE to construct DIBs from CBitmap s.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i'm sure c++ is very powerful, i would like to develop datadrive web applications using c++, is that possible? and would it be hard? i'm planning to use asp.net as my scripting language. instead of using C# or vb.net i would like to use c++. is there any refrence i could find out on the web?
thanks in advance.
Januola Likas Jun
|
|
|
|
|
You can do it via an ISAPI... You can find more explanation on this site in Web/Script (ISAPI)... It's easy to start an ISAPI in Visual C++... In new project choose ISAPI Extension wizard... Good Luck
|
|
|
|
|
As Guillaume pointed out, ISAPI is an option. Also, if you want to stay platform agnostic (ISAPI is mostly a Microsoft technology) you can always go for raw CGI. This spec is how all the dynamic content thing started some 10 years ago. Any CGI tutorial on the net should get you started. If you want some additional support for developing CGIs, search for CGI libraries (I've used in the past Stephen F. Booth's cgicc).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Of course, ISAPI is the way to go. On the other hand, you may want to try a new technology, called ATL Server (there is an article on it on CP). ATL Server is based on ISAPI, but it should ease the server-side programming.
I vote pro drink
|
|
|
|
|
would ISAPI dll's run on the unix apache severs?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
No. For Apache, you can develop modules in C/C++, but it seems to be a little more complicated than ISAPI.
I vote pro drink
|
|
|
|
|
If you are planning on using ASP.NET why not go with C# or VB.NET??
There are some good examples on this site dealing with datadriven web applications.
|
|
|
|
|
Indeed. Passing the Server, Session, Response, And Request objects around is far easier if you stick to one language. Plus, the caching engine in asp.net will be of more help.
// Rock
|
|
|
|
|
Hi,
I'm developping a COM application and I some problems have been appeared.
My application is called by a macro from the WinWord, some Dll's works but the Dll that has to show a dialog doesn't work.
I think my problem is with some Dll's from the system, because when VC++ is installed, or was installed, my application works perfectly. But I don't know how can I solve the problem.
So if someone can help, please send me an e-mail.
Thanks.
Otávio
otavio.romao@inatel.br
|
|
|
|
|
This gets answered at Mike Dunn's C++ FAQ (at the top of the page).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Make up your mind what forum you want answered in. Your title says COM problem, not Visual C++ problem. Posting ONCE to the appropriate forum will get you a better response.
|
|
|
|
|
My application has problem with VC++ too. It has some dependences which I still didn't find.
The application works in machines that already had or have the VC++ installed. So I think there're some files that are needed to execute the application, and I thought someone could help.
|
|
|
|
|
I posted something here before and got some helpful starts to Enum directories using FindfirstFile and FindNextFile etc. However, when I try this, it does not really do what I want. It looks for files OK but not directories.
Say I have a "d:\\Coil\\" directory. When I look for "d:\\coil\\*.*" underneath, it finds nothing. I can not locate any directories under it.
What I need to do is to erase directories that is no longer needed every so often (time based). Every director represent a day's worth of files. I want to erase old directories once it passes say 10 days.
Also, when I erase directories, it must be empty (so says MSDN and from what I have tried). Is there an easy way to just erase everything in the directory?
Thanks in advance.
|
|
|
|
|
Did you try "d:\\coil\\*" ?
|
|
|
|
|
Use FindFirstFile("D:\\coil\\*");
Regards...
There are two ways to write error-free programs; only the third one works.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I tried this. But when I look at the cFileName member of the WIN32_FIND_DATA struct, it only shows "." When I look at the FindNextFile it only has ".."
I can't tell what the directory actually is.
|
|
|
|
|
It's correct. Always you will find first "." then ".." and then the directoryes and the files.... Those marks are Dots. Are pointers to the Previous directory....
See under DOS. Make Dir *.* in a subdirectory not in C:\
If you want to find files in each FindNext you must to exclude the dots and the directoys
If(!pFind.IsDot() && !pFind.IsDirectory())
{
....
}
Best Regards
"A good programmer is someone who looks both ways before crossing a one-way street."
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Here you go :
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFile( _T("*.*"), &findData);
if( hFind != INVALID_HANDLE_VALUE)
{
do
{
//
if( ( findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) &&
( _tcscmp( findData.cFileName, _T(".")) != 0 ) &&
( _tcscmp( findData.cFileName, _T("..")) != 0 )
)
{
_tprintf( _T("%s\n"), findData.cFileName);
}
}
while( FindNextFile( hFind, &findData));
FindClose( hFind);
}
this will enumarate all the directories from the current dir. "." and ".." are the current directory and the parent directory. skip them.
|
|
|
|
|
I'm trying to run example 1-3 (shown belob) from the OpenGL programming guide (red book) using visual C++. I linked the necessary OpenGL libraries, OpenGL32.lib GLu32.lib and GLaux.lib. But I still get an error message that it cannot include the header file glut.h. This code is straight out of the book. What am I forgetting to do here?
#include<windows.h>
#include<stdlib.h>
#include<gl glut.h="">
static GLfloat spin = 0.0;
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotatef(spin, 0.0, 0.0, 1.0);
glColor3f(1.0, 1.0, 1.0);
glRectf(-25.0, -25.0, 25.0, 25.0);
glPopMatrix();
glutSwapBuffers();
}
void spinDisplay(void)
{
spin = spin + 2.0;
if(spin > 360.0)
spin = spin - 360;
glutPostRedisplay();
}
void reshape(int w, int h)
{
glViewport(0,0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROTECTION);
glLoadIdentity();
glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
if (state == GLUT_DOWN)
glutIdleFunc(spinDisplay);
break;
case GLUT_MIDDLE_BUTTON:
if (state == GLUT_DOWN)
glutIdleFunc(NULL);
break;
default:
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(mouse);
glutMainLoop();
return 0;
}
|
|
|
|
|
Just a wild guess, but I'd say the compiler can't find the header file.
Tip 1: Do a search on your drive to see if you have the glut.h header file. If you do, make sure you add its path to your project settings - and skip Tip 2.
Tip 2: If you don't have glut.h on your drive, get it. As far as I can remember, it comes with the OGL SDK. Check the OGL site for the latest version of the GLUT package.
J
|
|
|
|
|
My edit box code works just fine in debug mode, but it starts behaving very peculiar when I switch to release. Basically, I have a function that looks like this:
void CTerminalCtrl::GetCurrentLine(CString* strLine)
{
int nLines, nLineLength, nRes;
CString temp;
nLines = GetLineCount() - 1;
nLineLength = LineLength();
strLine->Empty();
GetLine(nLines, strLine->GetBuffer(nLineLength));
strLine->ReleaseBuffer();
}
LineLength returns the correct number of characters in the current line, but GetLine always returns zero in release mode, meaning it has copied nothing. strLine will thus be empty.
What is going on here?
Cheers,
/Fredrik
Sonork ID: 100.11430:PhatBoy
|
|
|
|
|
The documentation of CEdit::GetLine says that you've got to write the size of the buffer passed on the first word of that buffer. Alternatively, you can use the overload int GetLine(int nIndex,LPTSTR lpszBuffer,int nMaxLength) which does that job for you. I guess this is what it is causing your problem (in debug mode you probably are being lucky and whatever it is written in the buffer when you call GetLine makes the function satisfied).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Read Joseph M. Newcomers excellent article "Surviving the release"
mfg HintiFlo
|
|
|
|
|
I want to build Win32 Dll which exports only global functions. Client should load this Dll dynamically using LoadLibrary and call it's functions using GetProcAddress.
Internally in this Dll I want to use MFC. So I create Win32 Dynamic-Link Library project in Visual C++ and try to add MFC support to it. When I add MFC includes to the stdafx.h:
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
project is not linked (error message: second definition of DllMain).
How can I add MFC support to Win32 Dll?
|
|
|
|