|
I want to use the TCP headers but the tcp packet is not going on to the network.
Plz if you can help me in sending the TCP packet.
Any website,code for sending the TCP packet.
Reply me soon
|
|
|
|
|
If you set up the socket correctly then the TCP headers will always appear on the network, you dont need to create pseudo ones or even know they are there. I always use this:
int handle = socket (AF_INET, SOCK_STREAM, 0);
|
|
|
|
|
this code works if compiled with VS6, but gives wrong results with VC++.NET
int Y,U,V,R,G,B;
Y = lYUVColor.rgbRed;
U = lYUVColor.rgbGreen - 128;
V = lYUVColor.rgbBlue - 128;
R = (int)(Y + 1.403 * V);
G = (int)(Y - 0.344 * U - 0.714 * V);
B = (int)(Y + 1.770 * U);
replaceing the declaration of Y, everything is ok.
int U,V,R,G,B;
float Y = lYUVColor.rgbRed;
U = lYUVColor.rgbGreen - 128;
V = lYUVColor.rgbBlue - 128;
R = (int)(Y + 1.403 * V);
G = (int)(Y - 0.344 * U - 0.714 * V);
B = (int)(Y + 1.770 * U);
where is the bug? in the compiler or in the code?
|
|
|
|
|
Hi,,
I think the problem is in the code
Y + 1.403 * V<br />
Y - 0.344 * U - 0.714 * V<br />
Y + 1.770 * U (do you write a jpeg decoder/encoder?)
you use U (an int) and Y (an int) so te hole equation uses ints which means loss of accuracy (int truncates what comes after the period)
so when you use Y (float) the compiler does not truncate them...
|
|
|
|
|
hspc wrote:
do you write a jpeg decoder/encoder?
it's for CxImage
you'are right, but 1.403 is not an integer, so the * operator should give a floating point result, while in this case the result seems an integer.
in fact, another way to fix the problem is writing the constants with the "f" suffix: 1.403f and the routine works
|
|
|
|
|
Does any one knows where can i find the details / help about the API interface of VSS. ??
Any sample programs, tutorials etc. ??
I looked into MSDN and found only 1 page of documentation
I want to devlop an Addin which listens to the events of VSS(client / server) and performs some actions.
Please help.
thanks and regards.
- Vikram
|
|
|
|
|
|
Hi,
I insert a string table in my dll resource eidtor, and then export a fuction from this dll. in that function one of string IDs in the string table is showed by a Messagebox. The problem is: this message box shows nothing.
the following is my code:
Inside DLL
<br />
#include "Resource.h"<br />
<br />
__declspec(dllexport) void LoadMaya();
void LoadMaya()<br />
{<br />
CString strMaya;<br />
<br />
strMaya.LoadString(IDS_MAYA);<br />
AfxMessageBox(strMaya);<br />
<br />
}
Inside EXE
#include "..\MyDll\Maya.h"<br />
<br />
void CDllExeDlg::OnOK() <br />
{<br />
LoadMaya();<br />
<br />
CDialog::OnOK();<br />
}
<br />
Inside String Table
ID Value Caption
------------------------------------
IDS_MAYA 100 Maya Culture
Please single out the bug for me, thank you
Extreme programming. Do the No.1
|
|
|
|
|
Try:
void LoadMaya()
{
CString strMaya;
HINSTANCE hsav= AfxGetResourceHandle();
AfxSetResourceHandle(theApp.m_hInstance);
strMaya.LoadString(IDS_MAYA);
AfxMessageBox(strMaya);
AfxSetResourceHandle(hsav);
}
rechi
|
|
|
|
|
I have a problem with windows Medai Format SDK API .Iam trying to find if a ASF file is valis file or not .
IWMReader *m_pReader;
WCHAR wszFullUrl[ MAX_PATH ];
/*..create reader*******
.............
........*/
Here this represents a callback object
hr = m_pReader->Open(wszFullUrl , this, NULL );
if ( SUCCEEDED( hr ) )
{
//WaitForSingleObject( m_hOpenEvent, INFINITE );
_tprintf( _T( "successfull to open (hr=0x%08x)\n"), hr );
hr = m_hrOpen;
}
if ( NS_E_NO_STREAM == hr )
{
_tprintf( _T( "Waiting for transmission to begin...\n") );
//WaitForSingleObject( m_hOpenEvent, INFINITE );
hr = m_hrOpen;
}
if ( FAILED( hr ) )
{
_tprintf( _T( "failed to open (hr=0x%08x)\n"), hr );
return( hr );
}
When a give a invalid file name ,it gives the following output
successfull to open (hr=0x00000000)
failed to open (hr=0x80070002)
WHy does it give both the error messages ??Can somebody help me on this ??
|
|
|
|
|
Hi All,
I am trying to use a gradient control in my mfc app. And for that I downloaded the code from this website
http://www.codeproject.com/miscctrl/gradientprogressctrl.asp
I am using the GradientProgressCtrl.cpp class to implement in my mfc program. NOw one question is, since I am using the vertical control, how am I supposed to show the filling from BOTTOM TO TOP. The sample code shows the filling from top to bottom. I have looked into the code but nothing happened .
MY xyz.cpp uses it in the foll way where m_progbar is the instantiation of GradientProgressCtrl class. m_progbar is declared in xyz.h file.
m_Progbar.ShowPercent(TRUE);
m_Progbar.SetStep(20);
m_Progbar.StepIt();
My problem is that, after completion of 100 in the bar ctrl. I have to restart the app as filling of the bar stops after it completes the filling of the control.
I have triied lookin in the code but no use
Can you please help me with this.??
Thank a lot!!!
|
|
|
|
|
This isn't really a programming question I'm just wondering if visual safesource comes with either Visual Studio 6 or Visual Studio.net or both.
thanks you for your help
|
|
|
|
|
It's called Visual SourceSafe
It comes with VS .NET Enterprise Edition (and VS6 Enterprise Edition), and you can get it as a stand-alone product.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I am trying to use SHGetFolderLocation and keep getting
error C2065: 'SHGetFolderLocation' : undeclared identifier
I have tried linking shell32.lib and have the header #include <shlobj.h>
but I am doing something wrong.
I am using VC++6.0 sp5 Win XP, Thanks
I have been coding all morning, I am going to post this question and take a break hopefully someone can help. Hopefully I just need some fresh eyes. Thanks.
Later, JoeSox www.joeswammi.com Killing In The Name[^]
|
|
|
|
|
Try #define WINVER 0x0500 in stdafx.h
SHGetFolderLocation needs shell32.dll version 5.0, and needs Win ME or 2K, or newer, to run...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi there I import a Activex Control but when i try to compile it the debugger gives an error which is "Unhandled exception at 0x5046b2c4 in FirstChart.exe: 0xC0000005: Access violation reading location 0x5046b2c4."
What is the problem???
|
|
|
|
|
Hello
I have a CRichEditView based MDI application.
I would like to know how to access the GetRichEditCtrl() and its functions (such as ReplaceSel) when I'm in another class such as MainFrm
What I want to do, in short:
A non-modal Dialog box (using the Create and ShowWindow functions) to be accessible by both classes MainFrm and CHTMLEditorView (my rich edit view class)
Thanks a lot
|
|
|
|
|
>I would like to know how to access the GetRichEditCtrl() and its functions
>(such as ReplaceSel) when I'm in another class such as MainFrm
Following three statements give you your view from anywhere...
CMDIFrameWnd *pFrame = (CMDIFrameWnd *)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
CRichEditView *pView = (CRichEditView *) pChild->GetActiveView();
Obviously if you are calling from MDI you can use
CMDIChildWnd *pChild = (CMDIChildWnd *) GetActiveFrame();
CRichEditView *pView = (CRichEditView *) pChild->GetActiveView();
or simply
CRichEditView *pWnd = (CRichEditView *)MDIGetActive()->GetActiveView();
|
|
|
|
|
Hello
I would like to know who to add a line counter to the project. You know those gray bar to the left with line numbers which we can find in almost all those HTML editors.
Thanks for your help
|
|
|
|
|
Do you mean something to count the number of lines of code in your project, or a component to count the number of lines in some sort of edit control that is inside your application?
Dave
|
|
|
|
|
I am currently downloading a file from the web and checking info from it.
CStdioFile *remotefile;
CInternetSession mysession;
remotefile = mysession.OpenURL
(csUrl,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
if(!remotefile)
return 0;
My question is can i write to the file that i just opened and save it back on the web server.
If this doesn't work is there another method if i want to write to a file over the web?
Scott
|
|
|
|
|
I have used CFtpConnection::PutFile(..) fn for that. But might also look a t CInternetFile::Write(..)
Art
|
|
|
|
|
I'm doing some bencmarks on low-level high-priority threads, and I'd like to see how they do when some other process is hogging a large percenbtage of CPU resources - 80% or 90%.
Does anyone know of a utility that will suck CPU time through a straw?
Thx
|
|
|
|
|
while (1);
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
search for cpustres,exe, it's installed with Visual Studio.
It does exactly what you want.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|