|
Hi ,
If you may send me the code , I am in urgent need of it.
Thank You
Pankaj
|
|
|
|
|
|
Hi,
My query is based on vc++ 6.0.
Thank You
Pankaj
|
|
|
|
|
this[^] is as good as it gets
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I want to build a SDI (just) like Windows Explorer, have icon, and a icon have a text below, when i drag the icon, the text also follows. When i drop down, the new location is set for the icon & its text.
I'm the beginner.
Anyone can help me.
Thanks so much
|
|
|
|
|
|
I wanted to make some really large letters in my application but whenever I change the font size everything within the window becomes bigger, buttons, etc... Is there anyway to only change the letter font sizes only?
Thanks
|
|
|
|
|
If you change the font through Dialog Properties the dialog size will also be resized,
Instead change the font of a window from within the code
//put this in constructor
LOGFONT lf;
memset(&lf,0,sizeof(lf));
lf.lfHeight = -14;
lf.lfWeight = FW_BOLD;
lf.lfUnderline = (BYTE)TRUE;
_tcscpy(lf.lfFaceName,_T("Arial"));
m_fontBig.CreateFontIndirect(&lf);
Not set the font anywhere you like
m_targetWindow.SetFont(&m_fontBig);
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hi
for change font and font size you can use CreateFont and SelectFont
|
|
|
|
|
Dear friends,
I develop one application. I am trying to connect
proxy. I use Chttpconnection and CInternetsession
class. I connect proxy proper manner but I will not be
able to connect to the proper site that I want in my
application. what problem is suppose to occur. kindly
give me a reply.
Regards
kedar
Girish
Software Developer
|
|
|
|
|
Hello, I'm trying to compile a sample DLL that I found while searching on the forums here.
Here's the link to it:
http://www.codeproject.com/system/winlogon_notification_package.asp[^]
I'm coming from a VB background, so some of this stuff is kind of new to me. I have worked with VC++ 6.0 many times, but I have never compiled a DLL. Can anyone please provide a walkthrough on how to go about compiling this DLL. It would be helpful if you could provide a walkthrough for this example specifically since I have the code and can follow it easily.
I've tried numerous things and I have not been able to compile sucessfully. I'm simply copying and pasting the code from the above link into an MFC AppWizard (DLL) and then trying to compile. One error I keep getting is:
error C2065: 'PWLX_NOTIFICATION_INFO' : undeclared identifier
As mentioned before, I am simply copying and pasting so I have made sure to copy the includes. So I have no idea why it would say that PWLX_NOTIFICATION_INFO is "undeclared". It seems like I have tried everything and I don't know how to go about compiling. Any help would be greatly appreciated!
-- modified at 0:09 Saturday 11th March, 2006
|
|
|
|
|
nimishsudan wrote: error C2065: 'PWLX_NOTIFICATION_INFO' : undeclared identifier
Download New Plateform SDK (PSDK) from MS site or look in CD comes with MSDN Subscription
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: Download New Plateform SDK (PSDK) from MS site
I have already downloaded PSDK, I have version 5.2.3790.1830. Thanks for the quick reply! Any other ideas? Is there a specific project in VC++ that I need to create in order to compile the DLL? Or is there any way you can please set up the project files for me and attach them here so that I can take a look at them? Thanks again!
|
|
|
|
|
nimishsudan wrote: I have already downloaded PSDK, I have version 5.2.3790.1830. Thanks for the quick reply! Any other ideas? Is there a specific project in VC++ that I need to create in order to compile the DLL? Or is there any way you can please set up the project files for me and attach them here so that I can take a look at them? Thanks again!
Check have you defined WINVER 500 or 501 as this defination is only available for WINVER 500 and above
|
|
|
|
|
ThatsAlok wrote: Check have you defined WINVER 500 or 501
Where should I check this? If this is supposed to be in my code, I am copying the code exactly from the forum. Or is this supposed to be one of my environmental variables? Thanks again Alok!
|
|
|
|
|
nimishsudan wrote: Where should I check this? If this is supposed to be in my code,
In your stdafx.h file.. it is self generated according to vc version you are using
|
|
|
|
|
Well, I finally got the project to compile. I had to add the typedef struct for _WLX_NOTIFICATION_INFO and PFNMSGECALLBACK in order for it to compile without errors. But now my question is why doesn't it work? I have compiled the following code, and copied newNotif.exp and newNotif.dll to C:\Windows\System32\ and added the below registry entry to my registry. When I reboot, it doesn't do anything, not even the messagebox is displayed.
REGISTRY FILE:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\newNotif]
"Asynchronous"=dword:00000000
"Impersonate"=dword:00000000
"DllName"=hex(2):6e,00,65,00,77,00,4e,00,6f,00,74,00,69,00,66,00,2e,00,64,00,\
6c,00,6c,00,00,00
"Logon"="StartProcessAtWinLogon"
"Logoff"="StopProcessAtWinLogoff"
CPP FILE:
// newNotif.cpp : Defines the initialization routines for the DLL.
//
#include <windows.h>
#include <winwlx.h>
#include "stdafx.h"
#include "newNotif.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
typedef DWORD(* PFNMSGECALLBACK )(BOOL bVerbose, LPWSTR lpMessage);
typedef struct _WLX_NOTIFICATION_INFO { ULONG Size; ULONG Flags; PWSTR UserName; PWSTR Domain; PWSTR WindowStation; HANDLE hToken; HDESK hDesktop; PFNMSGECALLBACK pStatusCallback;
} WLX_NOTIFICATION_INFO, *PWLX_NOTIFICATION_INFO;
SafeTerminateProcess(HANDLE hProcess, UINT uExitCode);
/////////////////////////////////////////////////////////////////////////////
// CNewNotifApp
BEGIN_MESSAGE_MAP(CNewNotifApp, CWinApp)
//{{AFX_MSG_MAP(CNewNotifApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewNotifApp construction
CNewNotifApp::CNewNotifApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CNewNotifApp object
CNewNotifApp theApp;
PROCESS_INFORMATION g_pi;
TCHAR g_szPath[] = TEXT("C:\\Windows\\Notepad.exe");
//Entrance function for the DLL
BOOL WINAPI LibMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
DisableThreadLibraryCalls (hInstance);
}
break;
}
return TRUE;
}
//Event handler for the Winlogon Logon event
VOID APIENTRY StartProcessAtWinLogon (PWLX_NOTIFICATION_INFO pInfo)
{
TCHAR szText[MAX_PATH];
STARTUPINFO si;
si.cb = sizeof(STARTUPINFO);
si.lpReserved = NULL;
si.lpTitle = NULL;
si.lpDesktop = TEXT("WinSta0\\Default");
si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0L;
si.dwFlags = 0;;
si.wShowWindow = SW_SHOW;
si.lpReserved2 = NULL;
si.cbReserved2 = 0;
DWORD dwWritten;
HANDLE hFile = CreateFile(TEXT("c:\\TSP.txt"), GENERIC_ALL, NULL, NULL, OPEN_ALWAYS, NULL, NULL);
strcpy(szText, TEXT("StartProcessAtWinLogon \r\n"));
WriteFile(hFile, szText, strlen(szText), &dwWritten, NULL);
CloseHandle(hFile);
CreateProcess(NULL, g_szPath, NULL, NULL, FALSE, CREATE_NEW_CONSOLE,
NULL, NULL, &si, &g_pi);
MessageBox(NULL, "Winlogon Test", "Winlogon Test", MB_OK);
}
//Event handler for the Winlogon Logoff event.
VOID APIENTRY StopProcessAtWinLogoff (PWLX_NOTIFICATION_INFO pInfo)
{
//terminates the process
//****************SafeTerminateProcess(g_pi.hProcess, 0xDEADBEEF);
}
//other event handlers
VOID APIENTRY YOUR_EVENT_HANDLERS (PWLX_NOTIFICATION_INFO pInfo)
{
//code
}
// Here is the event handler for the Winlogon Logon event.
VOID WLEventLogon (PWLX_NOTIFICATION_INFO pInfo)
{
// Print the name of the handler to debug output.
// You can replace this with more useful functionality.
OutputDebugString (TEXT("NOTIFY: Entering WLEventLogon.\r\n"));
}
// Here is the event handler for the Winlogon Logoff event.
VOID WLEventLogoff (PWLX_NOTIFICATION_INFO pInfo)
{
// Print the name of the handler to debug output.
// You can replace this with more useful functionality.
OutputDebugString (TEXT("NOTIFY: Entering WLEventLogff.\r\n"));
}
HEADER FILE:
// newNotif.h : main header file for the NEWNOTIF DLL
//
#if !defined(AFX_NEWNOTIF_H__CEECF57A_5EFB_4B19_A60F_E05203D4E73C__INCLUDED_)
#define AFX_NEWNOTIF_H__CEECF57A_5EFB_4B19_A60F_E05203D4E73C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include <windows.h>
#include <winwlx.h>
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CNewNotifApp
// See newNotif.cpp for the implementation of this class
//
class CNewNotifApp : public CWinApp
{
public:
CNewNotifApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewNotifApp)
//}}AFX_VIRTUAL
//{{AFX_MSG(CNewNotifApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NEWNOTIF_H__CEECF57A_5EFB_4B19_A60F_E05203D4E73C__INCLUDED_)
|
|
|
|
|
Hi guys~ I need to build a 3D map system that will accept 2 inputs from users (the current location and the destination user wants to go), by clicking, then the system will generate a path from the current location to the destination.
At first I planed to use OpenGL to do so....but I faced one problem. The exporter that I used can only extract the vertices of the model I built in 3DsMax, not included the texture mapping! I already done nice mapping in 3DsMax and I think it takes time to do mapping in OpenGL.(total up 15 buildings need to be mapped)
Therefore, I switch to VRML (because the 3DsMax can export the model to VRML file with texture mapped)but I found VRML is dead and not powerful at all. Then I switch to Java3D but I heard someone says this programming is dying and will run slow! The most powerful tools for 3D Graphics Application still belongs to--->OpenGL!! And now I stuck here~Time passed away quickly and I still not yet done my system!
I need some help from you guys and suggestions, advices from you all~Please...please help~~~~sob sob////
I more familiar with OpenGL if compared with Java3D and VRML(both I learned 3 days ago only,very unfamiliar~)
I wish to extract the model(with texture mapped) to OpenGl then I can quickly concerntrate on my system(my due date for this project is coming soon)
Thanks a lot!
|
|
|
|
|
I think perhaps http://www.wotsit.org is helpful for you
|
|
|
|
|
Thanks Thanks Thanks....
I believe that site will help me out a lot.
|
|
|
|
|
check out http://www.openscenegraph.org/[^]
All the power of OpenGL, all the ease of higher level operation.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Oh...Thanks guys~I will check out on the site provided...really thanks!!!
|
|
|
|
|
Hi all,
i have write an application that create a movie from series of images. but i have some problem when writing the sample to the writer for the second times. It's return with error code NS_E_INVALID_DATA (0xc00d002f).
my complete code is like below :
// Aduuuuuuh.cpp : main project file.
#include "stdafx.h"
//#include <memory.h>;
#include "resource.h"
using namespace System;
using namespace System::Drawing;
int main(array<System::String ^> ^args)
{
IWMProfileManager *manager = NULL;
IWMProfile *profile = NULL;
IWMCodecInfo *codecInfo = NULL;
IWMMediaProps *mediaProps = NULL;
IWMStreamConfig *streamConfig = NULL;
WM_MEDIA_TYPE *mediaType = NULL;
WMVIDEOINFOHEADER *infoHeader = NULL;
IWMPropertyVault *propertyVault = NULL;
IWMWriter *writer = NULL;
IWMInputMediaProps *inputProps = NULL;
HRESULT hr = S_OK;
LONG vHeight = 240;
LONG vWidth = 320;
CoInitialize(NULL);
hr = WMCreateProfileManager(&manager); THROW_EXCEPTION(hr);
hr = manager->QueryInterface(IID_IWMCodecInfo, (void**)&codecInfo); THROW_EXCEPTION(hr);
hr = codecInfo->GetCodecFormat(WMMEDIATYPE_Video, 6, 0, &streamConfig); THROW_EXCEPTION(hr);
hr = streamConfig->QueryInterface(IID_IWMMediaProps, (void**)&mediaProps); THROW_EXCEPTION(hr);
DWORD count = 0;
hr = mediaProps->GetMediaType(NULL, &count); THROW_EXCEPTION(hr);
mediaType = (WM_MEDIA_TYPE*) new BYTE[count];
hr = mediaProps->GetMediaType(mediaType, &count); THROW_EXCEPTION(hr);
infoHeader = (WMVIDEOINFOHEADER*)mediaType->pbFormat;
infoHeader->dwBitRate = 100000;
infoHeader->AvgTimePerFrame = ((LONGLONG)10000000 / (LONGLONG) 30);
infoHeader->bmiHeader.biWidth = vWidth;
infoHeader->bmiHeader.biHeight = vHeight;
infoHeader->bmiHeader.biSizeImage = vWidth * vHeight * 3;
infoHeader->rcSource.right = vWidth;
infoHeader->rcSource.bottom = vHeight;
infoHeader->rcTarget.right = vWidth;
infoHeader->rcTarget.bottom = vHeight;
mediaProps->SetMediaType(mediaType);
//delete[] mediaType;
//hr = streamConfig->QueryInterface<IWMPropertyVault>(&propertyVault);
//BOOL isVBR = FALSE;
//hr = propertyVault->SetProperty(g_wszVBREnabled, WMT_TYPE_BOOL, (BYTE*)&isVBR, sizeof(isVBR)); THROW_EXCEPTION(hr);
hr = manager->CreateEmptyProfile(WMT_VER_9_0, &profile); THROW_EXCEPTION(hr);
hr = streamConfig->SetStreamNumber(1); THROW_EXCEPTION(hr);
hr = streamConfig->SetBitrate(100000);THROW_EXCEPTION(hr);
hr = streamConfig->SetBufferWindow(3000);THROW_EXCEPTION(hr);
hr = profile->AddStream(streamConfig); THROW_EXCEPTION(hr);
CoInitialize(NULL);
hr = WMCreateWriter(NULL, &writer); THROW_EXCEPTION(hr);
hr = writer->SetProfile(profile); THROW_EXCEPTION(hr);
hr = writer->GetInputProps(0, &inputProps);THROW_EXCEPTION(hr);
count = 0;
hr = inputProps->GetMediaType(NULL, &count);THROW_EXCEPTION(hr);
mediaType = (WM_MEDIA_TYPE*) new BYTE[count];
hr = inputProps->GetMediaType(mediaType, &count); THROW_EXCEPTION(hr);
mediaType->subtype = WMMEDIASUBTYPE_VIDEOIMAGE;
hr = inputProps->SetMediaType(mediaType);THROW_EXCEPTION(hr);
infoHeader = (WMVIDEOINFOHEADER*) mediaType->pbFormat;
hr = inputProps->SetMediaType(mediaType);THROW_EXCEPTION(hr);
//delete[] mediaType;
//------------------- writing
hr = writer->SetOutputFilename(L"C:\\Pliiiis.wmv");THROW_EXCEPTION(hr);
hr = writer->BeginWriting(); THROW_EXCEPTION(hr);
#pragma region convert bitmap to byte*
Bitmap ^gambar = gcnew Bitmap("C:\\source.bmp");
array<unsigned char, 1>^ memStr = gcnew array<unsigned char, 1>(vWidth * vHeight * 3 + 54);
System::IO::MemoryStream ^ms = gcnew System::IO::MemoryStream(memStr);
gambar->Save(ms, Imaging::ImageFormat::Bmp);
BYTE* bmp = new BYTE[vWidth * vHeight * 3];
for(int i = 54; i < ((vWidth * vHeight * 3) + 54); i ++)
{
*(bmp + i - 54) = memStr[i];
}
#pragma endregion
#pragma region Sample header 1
WMT_VIDEOIMAGE_SAMPLE2 *sample = (WMT_VIDEOIMAGE_SAMPLE2*) new BYTE[sizeof(WMT_VIDEOIMAGE_SAMPLE2)];
sample->dwMagic = WMT_VIDEOIMAGE_MAGIC_NUMBER_2;
sample->dwStructSize = sizeof(WMT_VIDEOIMAGE_SAMPLE2);
sample->dwViewportWidth = vWidth;
sample->dwViewportHeight = vHeight;
sample->dwCurrImageWidth = vWidth;
sample->dwCurrImageHeight = vHeight;
sample->fCurrRegionX0 = 0;
sample->fCurrRegionY0 = 0;
sample->fCurrRegionWidth = (FLOAT)vWidth;
sample->fCurrRegionHeight = (FLOAT)vHeight;
sample->dwPrevImageWidth = vWidth;
sample->dwPrevImageHeight = vHeight;
sample->fPrevRegionX0 = 0;
sample->fPrevRegionY0 = 0;
sample->fPrevRegionWidth = (FLOAT)vWidth;
sample->fPrevRegionHeight = (FLOAT)vHeight;
sample->dwEffectType = 0;
sample->dwNumEffectParas = 0;
sample->bKeepPrevImage = FALSE;
sample->dwControlFlags = WMT_VIDEOIMAGE_SAMPLE_INPUT_FRAME;
//TODO : create blending transision here
sample->fCurrBlendCoef = 1;
sample->fPrevBlendCoef = 0;
#pragma endregion
INSSBuffer *buffer = NULL;
QWORD timeCounter = 0;
QWORD vidTime = 0;
DWORD len = vHeight * vWidth * 3;
for(int i = 0; i < 60; i ++)
{
#pragma region first photo
if(i == 0)
{
BYTE *loc = NULL;
DWORD sampleSize = sizeof(WMT_VIDEOIMAGE_SAMPLE2);
DWORD size = len + sampleSize;
hr = writer->AllocateSample(size, &buffer);THROW_EXCEPTION(hr);
DWORD bufferLength = 0;
buffer->GetBufferAndLength(&loc, &bufferLength);
errno_t err = memcpy_s(loc, sampleSize, sample, sampleSize);THROW_EXCEPTION(hr);
err = memcpy_s((loc + sampleSize), len, bmp, len);
hr = buffer->SetLength(size);
THROW_EXCEPTION(hr);
hr = writer->WriteSample(0, vidTime, 0, buffer);THROW_EXCEPTION(hr);
//delete loc;
//loc = NULL;
buffer->Release();
buffer = NULL;
}
#pragma endregion
#pragma region the next
else
{
sample->dwControlFlags = WMT_VIDEOIMAGE_SAMPLE_OUTPUT_FRAME |
WMT_VIDEOIMAGE_SAMPLE_USES_CURRENT_INPUT_FRAME;
BYTE *loc = NULL;
DWORD size = sizeof(WMT_VIDEOIMAGE_SAMPLE2);
hr = writer->AllocateSample(size, &buffer);THROW_EXCEPTION(hr);
buffer->GetBuffer(&loc);
memcpy_s(loc, size, sample, size);
hr = buffer->SetLength(size);THROW_EXCEPTION(hr);
//------------------------Error appears here with code NS_E_INVALID_DATA
hr = writer->WriteSample(0, vidTime, 0, buffer);THROW_EXCEPTION(hr);
buffer->Release();
buffer = NULL;
}
#pragma endregion
vidTime = (++timeCounter * 1000)/30;
}
hr = writer->EndWriting();THROW_EXCEPTION(hr);
return 0;
}
|
|
|
|
|
Sir,
I amd Suresh Kumar want to know the differences between the VC++ and .Net. Please send me the differences I request. I referred many books but i didn't get any information regarding this and also searched on internet in many sites
including Microsoft.
Regards,
S.Suresh Kumar
Suresh Kumar
|
|
|
|
|
http://www.codepedia.com/2/FAQ-VCDOTNET-VC6-VCDOTNET-Differences
|
|
|
|
|