|
How can you do this for other browsers like Netscape or Opera? Can this be done for other browsers?
http://www.codeproject.com/useritems/iemozilla.asp[^]
If it has been done can you tell where I can learn more about this or other good resource sites like the link above.
Thanks,
|
|
|
|
|
Hi,
I wrote the proxy app (WinSock) forwarding data from one socket to another. I listen for the client connection on the first socket, when the connection is established I create second socket and connect to the destination. Than I only forwarding data using these 2 sockets (client & destination).
My question: is it possible (after accept client connection) to bind client & destination sides without creating 2 sockets ? I mean, how to reroute connection only, without using my proxy to forward the data.
Thanks
------------------
PeterP
|
|
|
|
|
PeterP2004 wrote:
is it possible (after accept client connection) to bind client & destination sides without creating 2 sockets ? I mean, how to reroute connection only, without using my proxy to forward the data.
No, it's not possible. Once a socket is connected, it cannot be reconnected without being disconnected first, and the reconnection can only be initiated by the client.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm trying to get Bumbleebee Software's lex and yacc generator up and running. I'm pretty experienced with lex and yacc, but only on unix systems. The problem is, if I use Bumblebee's ParserWizard, I get a good grammar and can compile, but the resulting application (I'm building into a windows console application) always crashes. I've tried "empty" grammars. I've also tried a grammar that can only produce a single non-terminal, i.e., it should be able to match an input of "binky", and nothing else. No matter what I try, the resulting application always crashes. I've tried reading from stdin and from a file, with no luck. I wish I could copy and paste some of the examples provided with bumblebee (like the calculator grammar), but it seems that most of them are the grammar without an accompanying lexer. I had hoped that there would be a complete example that I could compile in ParserGenerator and then compile in Visual C++ and have a working application (no matter how simple). But, apparently, no luck there.
I would be immensely grateful for any of the following:
1. Any simple grammar (and lexer if needed) that I can compile in Bumblebee and then MSVC and run the resulting console app without a crash.
2. Advice, tips, suggestions on what is needed to get a working Bumblebee generated grammar and lexer. I obviously don't know why my parsers and lexers are not working. Could it be because under unix, anything not parsed gets dumped to stdout, and this is not acceptable in windows? Is it something else that I have not done properly?
Thanks for any help you can offer!
maxmaven
|
|
|
|
|
I haven't used Bumblebee, but I have recompiled the linux flex and bison source and used them under Windows. I've never had the resulting scanners/parsers crash (except for my coding errors of course). I dunno if that helps much, but I can say it's not because of Windows.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I want to create an installation program for my program.Cause it will use some System resource.
Can you tell me where I can get the sample code and
useful tips?
|
|
|
|
|
|
Hi!Larry Antram,
Thank you very much! It's just what I want.
Cheers!
momer
|
|
|
|
|
I have just added a menu to an MFC dialog box and it comes up and works, but it does not look good under Windows XP. With the default XP color scheme, the background of the dialog and the menu bar should be tan, but behind the menu text the menu bar is white. Around the text the menu bar is tan. The drop down menus look normal with white backgrounds and tan borders. I'm sure this is a frequently encountered problem, but I have not been able to find anyone else's solution. Can someone give me a clue?
-Uncle Vance
|
|
|
|
|
actually i'm not really can speak in english very well...
a week ago, i have recived a final project title. my title is "SOFTWARE ARCHITECTURE FOR MACHINE INTERFACE USING VISUAL C++". the problem is i did not know what the meaning of this title. what is the interface?? is that i must build a driver?? what are the best machine should i choose?? is that to hard to make this project?? is anybody can tell me what should i do?? where i can get the C++ code for solve this project??
i'm very² need help from anybody that can help me to finish my final project.
|
|
|
|
|
Why Can't you ask your teacher or teacher's assistant ?
it's vague, don't you have a real description for YOUR homework ? a set of criteria, instructions, course-ware, books, classes notes ?
don't want to sound rude, but your not giving us much ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
An interface is something that makes one thing interact with another. For instance a Human Machine Interface handles the Human interaction with the machine. Is your project suppose to handle the interaction between t
|
|
|
|
|
I'm trying to print an image to an area with certain dimensions in GDI+. First I construct a graphics object:
Graphics graphics(dc.m_hDC);
Then I load the image and print it:
graphics.DrawImage(pImage, rfDraw, rfPic.X, rfPic.Y, rfPic.Width, rfPic.Height, UnitPixel);
The rfPic rectangle is the source area to draw from, containing e.g. (0, 0, 1000, 800), the entire 1000 x 800 pixel image (I need to have the possibility to draw a portion of the image). The rfDraw rectangle is the destination area to draw to, containing e.g. (100, 100, 6100, 4900).
The printer has a 600 x 600 dpi resolution. Thus the printed image should be:
(6100 - 100) pixels / 600 dpi = 10 inches wide, and:
(4900 - 100) pixels / 600 dpi = 8 inches high.
However, the image is blown up to gigantic proportions. Can someone tell me why?
With smaller values in rfDraw , it works as expected when drawing to screen (which is 'just another device', but with 96 dpi). Also, similar code worked perfectly in GDI (without the +), using IPicture . I ported the code to GDI+, to be able to rotate and more.
I tried: using other unit values, like UnitDocument ; setting the page scale and units to different values; checking the device resolution (indeed 600 dpi in both directions).
This is costing me a lot of paper and printer cartridges! Please help!
Thanks in advance!
|
|
|
|
|
Hi ..
Is there anyway.. to get the icon for the given file name? in c++?
I tried to convert following vb code to c++ using VS.Net. but I got errors
<br />
Function GetIconLocation(ByVal filename As String, ByVal index As Integer) As String<br />
Dim loc As String<br />
'Use this to get the small icon.<br />
Dim shinfo As SHFILEINFO<br />
shinfo = New SHFILEINFO<br />
Dim hImgSmall As IntPtr 'The handle to the system image list.<br />
<br />
hImgSmall = SHGetFileInfo("c:\" & filename, 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON Or SHGFI_LARGEICON)<br />
Dim hIcon As Icon<br />
'hIcon = hIcon.FromHandle(hImgSmall)<br />
hIcon = Icon.FromHandle(shinfo.hIcon)<br />
Dim bip As System.Drawing.Bitmap<br />
bip = hIcon.ToBitmap()<br />
loc = "c:\icon" & index.ToString & ".png"<br />
bip.Save(loc)<br />
loc = "<img src=""" & loc & """><br><font size=""-2"" face=""Times"">" & filename & "</font>"<br />
shinfo = Nothing<br />
Dim f As File<br />
f.Delete("c:\" & filename) ' delete the file<br />
GetIconLocation = loc
end Function
I tried to used
<br />
#using <mscorlib.dll><br />
#using <System.dll><br />
using namespace System;<br />
using namespace System::IntPtr;<br />
I dont' know how to use those namespace System classes from regular c++ in Visual Studio .Net.
Can anyone help me please?
Thank you.
but
|
|
|
|
|
pnpfriend wrote:
Is there anyway.. to get the icon for the given file name?
ExtractIcon() comes to mind.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am drawing a newbie blank here. Can someone show me how to read 20 bytes from the serial port using this code:
BOOL CSerialPort::ReadByte(BYTE &resp)
{
BYTE rx;
resp=0;
DWORD dwBytesTransferred=0;
if (ReadFile (hComm, &rx, 1, &dwBytesTransferred, 0))
{
if (dwBytesTransferred == 1)
{
resp=rx;
return true;
}
}
return false;
}
Thanks
|
|
|
|
|
I think you can solve this problem by the following code:
BYTE byte2Read[20];
for( int nRead=0; nRead<20;)
{
if( ReadByte( byte2Read[nRead] ) )
{
nRead++;
}
}
Coding,I love it! MM,I Love it 2!!
|
|
|
|
|
Can someone tell me why this isn't freeing up the memory like it suppose to?
Thanks
#include <afxwin.h>
#include <iostream.h>
class CDeeper : public CObject{
private:
CString *strTemp;
public:
CDeeper():strTemp(new CString){}
~CDeeper(){}
void setStr(CString setTemp){ *strTemp = setTemp; }
void Delete(){ delete strTemp; strTemp = NULL; }
};
class CTest : public CDeeper{
private:
int num;
CObList DeeperList;
CDeeper *pDeeper;
public:
CTest(){}
~CTest(){}
void setStr(int i){
num = i;
pDeeper = new CDeeper;
pDeeper->setStr("Hello");
DeeperList.AddTail(pDeeper);
}
void Delete(){
POSITION pos;
pos = DeeperList.GetHeadPosition();
while(pos){
pDeeper = (CTest *)DeeperList.GetNext(pos);
pDeeper->Delete();
delete pDeeper;
}
DeeperList.RemoveAll();
}
};
int main(){
POSITION pos;
CObList strList;
CTest *pTest;
int i;
for (i=0; i< 50000; i++){
pTest = new CTest;
pTest->setStr(i);
strList.AddTail(pTest);
}
pos = strList.GetHeadPosition();
while(pos){
pTest = (CTest *)strList.GetNext(pos);
pTest->Delete();
delete pTest;
}
strList.RemoveAll();
return 0;
}
|
|
|
|
|
Change CDeeper to:
class CDeeper : public CObject
{
private:
CString *strTemp;
public:
CDeeper(){}
~CDeeper(){}
void setStr(CString setTemp){ strTemp = new CString(setTemp); }
void Delete(){ delete strTemp; strTemp = NULL; }
};
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I found out I can do
class CDeeper : public CObject{
private:
CString *strTemp;
public:
CDeeper():strTemp(new CString){}
~CDeeper(){ delete strTemp; strTemp = NULL; }
void setStr(CString setTemp){ *strTemp = setTemp; }
void Delete(){ }
};
Now I need to figure out why the three cases are different
|
|
|
|
|
One additional question on this. I notice when I call delete pTest it calls the destructor again and strTemp at that point is pointing to an unknown location with no value.
Anyway to prevent that?
|
|
|
|
|
Hi this is my first time using MFC and I just created a basic MFC aplication where you can enter data and display a calculated result (dialogue based). However I need to incorporate some file input and output which i wrote using a win32 console application <fstream>. Is there an easy way to allow MFC to recongise <fstream> because atm its having none of it?
|
|
|
|
|
When CHtmlView completes loading document it steals focus. How to avoid this?
|
|
|
|
|
I have a program with an active x control. Before I can run the program properly, I need to locate the .ocx file, and then register the control. Just what is an ocx file? What does registering the active x control do?
Thanks.
Jerry
|
|
|
|
|
An OCX is simply a DLL with a different extension, nothing more, nothing less. If it supports self-regisration (and almost all do), it will export a function called DllRegisterServer. The writer of the OCX puts whatever functionality is necessary to register the OCX correctly in this function. This is typically just adding some registry keys.
Note that an OCX does not *have* to export a DllRegisterServer function - you could just list the registry entries needed for correct operation in a text document shipped with the OCX - but every commercial OCX I've ever come across does.
To register the OCX, load it using LoadLibrary , get a pointer to the DllRegisterServer function using GetProcAddress , and then call the function itself. DllRegisterServer is a void function that takes no parameters.
|
|
|
|