|
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?
|
|
|
|
|
This question was asked here some months ago. I'd say the best way to accomplish this is creating a fresh MFC DLL project and then transferring your Win32 code to it. I did it myself when I needed to add some internal MFC support for a DLL of mine and everything was set up and working in minutes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you. Can you give some additional information, please. Suppose I create new VC project of type MFC AppWizard (dll), and select "MFC Extension Dll (using shared MFC DLL)" on step 1. Now I have priject with DllMain. I can add to it classes, if I want to export them I write AFX_EXT_CLASS. But I need to export functions and not classes, as from Win32 Dll. My question now is: how can I add exported functions to MFC Extension Dll?
|
|
|
|
|
You export regular functions just the way you used to when the DLL hadn't MFC support: either with __declspec(dllexport) or resorting to .DEF files. Also, it helps having these functions declared as extern "C" so that you don't have to mess around with name decorating.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
How can i catch the events fired by an ActiveX control without using Class Wizard ?
I'm creating the controls at runtime that's why i can't use the ClassWizard to create the Event Sink Map.
Abdiel Jaramillo
Arango Software International
Panama, Rep. of Panama.
|
|
|
|
|
If creating another AcitveX control is your cup of tea, then you may try to use my class XYDispDriver to handle events. Basically, you create another control as your event handler (you can use ATL or MFC to create the event handler control). Please see my articles for details.
Warning: It only works with non-GUI controls (and the interface has to be derived from IDispatch) and it has been voted the "most hated" method by some ATL "experts".
|
|
|
|
|
I'm not creating another control. I create various CWebBrowser controls in a form view and need to catch the DocumentComplete event but i can't use the EVENT_SINK_MAP macros because i'm creating the controls at runtime.
Thanks
Abdiel Jaramillo
Arango Software International
Panama, Rep. of Panama.
|
|
|
|