|
|
|
Dear :
is it possible to do Response.Redirect("login.aspx") functionality in Visual C++ ?
Regards
|
|
|
|
|
some info required. From where you want to do this. Isapi extensions or com dll loaded by ur asp page ...?
There is no spoon.
mail
|
|
|
|
|
Oh! Sorry, I need to implement this inside ISAPI Filter.
Regards
|
|
|
|
|
DWORD CYourFilter::OnPreprocHeaders(
CHttpFilterContext* pCtxt,
PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo
)
{
if (bRedirect)
{
TCHAR *szRedirectUrl[]= _T("http://url/xxx.asp");
pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", szRedirectUrl);
return SF_STATUS_REQ_HANDLED_NOTIFICATION;
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
There is no spoon.
mail
|
|
|
|
|
|
hi all,
i am looking for a complete sample for Zlib compression/decompression.Anyone knows the source of sample?
Thanks in advance
Abhishake
|
|
|
|
|
Try here http://www.winimage.com/zLibDll[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Recently,I see the program written by other people.
At his program,there is a function WinMain which has a parameter lpCmdLine.And it use this parameter at his program.
I want to use the lpCmdLine parameter at my dialog based program. But I don't know how I can get the value of this parameter at my dialog based program.
Could you tell me how?
Which function provides the function ?
Thanks!
The WinMain function at his program is as follows:
int PASCAL WinMain(HINSTANCE hInstC, HINSTANCE hInstP, LPTSTR lpCmdLine, int nCmdShow)
{................}
free like a bird
|
|
|
|
|
GetCommandLine()
There is no spoon.
mail
|
|
|
|
|
CWinApp::m_lpCmdLine points to the same TCHAR * as the one provided by the WinMain function in the lpCmdLine argument.
There is also a helper member function to ease the argument parsing: CWinApp::ParseCommandLine.
Guoguor wrote:
The WinMain function at his program is as follows:
int PASCAL WinMain(HINSTANCE hInstC, HINSTANCE hInstP, LPTSTR lpCmdLine, int nCmdShow)
Amazing
Actually, this is required signature for the entry point for a windows program. Your dialog based program also defines such a function, but MFC hides all the dirty details, so that you can only see the dirty details of MFC...
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Hi,
when the check box is checked,by clicking the control button, it should be in the pushed mode.
When i uncheck the check box, the control button should return to the normal mode.
How is it possible?
Pls help.
Mithuna
|
|
|
|
|
Use a toggle button for this. It nothing but a check box with style "push like = true".
If you want to set this at run-time then use BS_PUSHLIKE.
There is no spoon.
mail
|
|
|
|
|
Hi,
I have written a program in which I have included another file in which my whole class declaration is defined. It is compiling without any errors but givin linking errors. I did reffered to Microsofts reference over net for tht error.. but didn't get anything from it...here is my code...
Main program (heel.cpp)...
#include <fstream.h>
#include <iostream.h>
#include <math.h>
#include <conio.h>
#define phi 3.1412
#include "geom.cpp"
void main()
{.......
....
Cube *C = new Cube[50];
....
for(...)
C[i].set_values(dis,dim,res1);
...
..
}
Another program (geom.cpp) in which the class is defined, where all the methods are defined in this file only....(here i haven't included any header files)
class Cube
{
public:
--data members declaration.....
public:
Cube();
void set_values(double x, double y, int z);
void set();
void process();
int check(int i, int j);
};
this is the error tht i am getting...
Linking...
heel.obj : error LNK2001: unresolved external symbol "public: static int (* Cube::bound1)[2]" (?bound1@Cube@@2PAY01HA)
Debug/heel.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
any help is appreciated....
thanks in advance,
Suman
|
|
|
|
|
suman if i am getting it correctly, you have a file named heel.cpp (main file) and a file named geom.cpp which contains your class declaration. if this is the case then the linker error is due to the fact that you have declared member functions in your class but havn't defined them any where
to remove the linker error either write you geom.ccp file as
class Cube
{
public:
--data members declaration.....
public:
Cube()
{
}
void set_values(double x, double y, int z)
{
}
void set()
{
}
void process()
{
}
int check(int i, int j)
{
}
};
or define you members in a separet file e.g
file:geom.h
class Cube
{
public:
--data members declaration.....
public:
Cube();
void set_values(double x, double y, int z);
void set();
void process();
int check(int i, int j);
};
file: geom.cpp
#include "geom.h"
Cube::Cube()
{
}
void Cube::set_values(double x, double y, int z)
{
}
void Cube::set()
{
}
void Cube::process()
{
}
int Cube::check(int i, int j)
{
}
and in you heel.cpp file just include geom.h like this:
#include "geom.h"
Hope this will remove the linker error . plz inform me if this works or still you are getting same error
regards
Muhammad Azam
ned_azam@yahoo.com
muhammadazam_cis08@hotmail.com
|
|
|
|
|
also if you have an static data member in your class, like it seems that you have declared static int bound; or something like this then out side your class write int cube::bound=0; like
class cube
{
static int bound;
.
.
.
}
int cube::bound=0;
this may also be the couse of your linker error
regards
Muhammad Azam
ned_azam@yahoo.com
muhammadazam_cis08@hotmail.com
|
|
|
|
|
Hi Azam,
thanks for ur valuable reply. Actually the second reply worked out. Its due to the static declaration in the class. Anyway now I am using direct declaration witout static.
but i want to know how to declare a static type in a class. I have tried the way u specified but then the compiler is giving me error. My bound variable is a 2D array.
once again thanks,
Suman
|
|
|
|
|
Hi suman
i think you are trying to declare a 2D static array of integers like this
static int bound1[10][10] in your class.
Suman, static members are basically class members and they must be defined expilicitly after your class definition. like i have declared something like static int bound1[10][10] in my geom.h file and when i compiled the program i got the same linker error as you stated, then i defined int Cube::bound1[2][2]={0}; in my geom.cpp file before defining constructor or any other member then there was no linker error ( notice class declaration in .h file and definition in .cpp file.
suman, in C++ we say static members are like 'metadata' (data about data). e.g if you want to know at some time how many objects of your class are there in memory then static member is used for this purpose like
file: test.h
class ABC
{
public:
static int counter;
private:
[some members]
public
ABC();
~ABC();
[some methods]
};
file: test.cpp
int ABC::counter = 0;
ABC::ABC
{
counter++;
}
ABC::~ABC
{
counter--;
}
and in main progeam
file: Main.cpp
#include "test.h"
void main (void)
{
ABC obj1,obj2,obj3;
cout<<ABC::counter;
}
output: 3
|
|
|
|
|
Hi Azam,
thanks for ur advice and suggestion and explaining in such a detail. I got ur point and defined in the same way tht u have explained.
cheers,
pavan.
Suman
|
|
|
|
|
you are welcome
its my pleasure if i could be of any help for you in this regard.
Azam
|
|
|
|
|
|
How can I disable [X] button on right-top corner of the sub-window? What I mean here is a MDI application. I want to disable [X] button of childwindow. However I'm not sure whether the [X] button belongs to childwindow or not.
I like show my knowledge with others
|
|
|
|
|
Try using this code
UINT menuf = bEnable ? (MF_BYCOMMAND) : (MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);
CMenu* pSM = GetSystemMenu(FALSE);
if(pSM)
{
pSM->EnableMenuItem(SC_CLOSE, menuf);
}
This will work
|
|
|
|
|
> CMenu* pSM = GetSystemMenu(FALSE);
Thank you for you reply. But I have a question, how can you confirm its ChildWindow's menu or something else?
I have try the following method, but it doesn't take effect:
CMDIChildWnd *pCMDIChildWnd = MDIGetActive();
CMenu *pMenu = pCMDIChildWnd->GetSystemMenu(FALSE);
pMenu->EnableMenuItem(ID_xxx, MF_BYCOMMAND | MF_GRAYED);
|
|
|
|