|
How do I start programming a Visual Basic Add-In? I tried the following:
#import "C:\\Program Files\\Microsoft Visual Basic\\VB98\\VB6EXT.OLB"
The compiler failed when it tried to define the 'CommandBarsPtr' type.
Any ideas?
Thanks in advance
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
I'm wondering if it's at all possible to determine the hard drive location of a program from within that program. Any help would be greatly appreciated!
-Sparticus
|
|
|
|
|
char appPath[MAX_PATH+1];
DWORD res = GetModuleFileName(AfxGetInstanceHandle(), appPath, MAX_PATH);
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Greetings,
I am trying to get the length of the avi source file, and to play it in the time line at that length,
but for some reason I am always getting a "0" returned for the media length. Any suggestions on how
to retreive these?
I am under Windows 2000, and I am using directx 8.0 sdk with visual C++ 6.0.
The code I am having trouble with is marked below as "// PROBLEM AREA!!!!"
// ------------------------------------------------------------------
// Code from Directx 8.0 sdk help file.
// <article:> (Constructing a Timeline)
// ------------------------------------------------------------------
void main( void )
{
// Start by making an empty timeline.
IAMTimeline *pTL = NULL;
CoInitialize(NULL);
CoCreateInstance(CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER,
IID_IAMTimeline, (void**)&pTL);
// GROUP: Add a video group to the timeline.
IAMTimelineGroup *pGroup = NULL;
IAMTimelineObj *pGroupObj = NULL;
pTL->CreateEmptyNode(&pGroupObj, TIMELINE_MAJOR_TYPE_GROUP);
pGroupObj->QueryInterface(IID_IAMTimelineGroup, (void **)&pGroup);
// Set the group media type.
AM_MEDIA_TYPE mtGroup;
ZeroMemory(&mtGroup, sizeof(AM_MEDIA_TYPE));
mtGroup.majortype = MEDIATYPE_Video;
pGroup->SetMediaType(&mtGroup);
pTL->AddGroup(pGroupObj);
pGroupObj->Release();
// TRACK: Add a track to the group.
IAMTimelineObj *pTrackObj;
IAMTimelineTrack *pTrack;
IAMTimelineComp *pComp = NULL;
pTL->CreateEmptyNode(&pTrackObj, TIMELINE_MAJOR_TYPE_TRACK);
pGroup->QueryInterface(IID_IAMTimelineComp, (void **)&pComp);
pComp->VTrackInsBefore(pTrackObj, 0);
pTrackObj->QueryInterface(IID_IAMTimelineTrack, (void **)&pTrack);
pTrackObj->Release();
pComp->Release();
pGroup->Release();
// SOURCE: Add a source to the track.
IAMTimelineSrc *pSource = NULL;
IAMTimelineObj *pSourceObj;
pTL->CreateEmptyNode(&pSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);
pSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pSource);
// PROBLEM AREA!!!!
// How do I see how long the avi file is, and set the timeline to stay for that long????
// For some reason pSource->GetMediaLength(ref); always returns "0"???
// Set the times and the file name.
pSourceObj->SetStartStop(0, 50000000);
pSource->SetMediaName(L"C:\\MyExample.avi");
pSource->SetMediaTimes(40000000, 140000000);
pTrack->SrcAdd(pSourceObj);
pSourceObj->Release();
pSource->Release();
pTrack->Release();
// Preview the timeline.
IRenderEngine *pRenderEngine = NULL;
CoCreateInstance(CLSID_RenderEngine, NULL, CLSCTX_INPROC_SERVER,
IID_IRenderEngine, (void**) &pRenderEngine);
PreviewTL(pTL, pRenderEngine);
// Clean up.
pRenderEngine->ScrapIt();
pTL->ClearAllGroups();
pRenderEngine->Release();
pTL->Release();
CoUninitialize();
}
|
|
|
|
|
Hello,
How can one remove the scrollbars from a CFormView based app? I've spent way too many hours trying to figure this one out.
I've tried ModifyStyle(WS_HSCROLL | WS_VSCROLL, 0);
I've tried cs.style = ~WS_HSCROLL | ~WS_VSCROLL;
This should be simple, and its driving me crazy!!!
Thanks!
Frank
|
|
|
|
|
In your OnInitialUpdate() function, add this code:
SetScrollSizes(MM_TEXT,CSize(0,0));
Hadi Rezaie
|
|
|
|
|
Thanks Hadi!
It worked perfectly.
Frank
|
|
|
|
|
I had an ActiveX control in my C++ project but deleted it. It still shows up in the Class Wizard control list though. How do I remove all references to a control from a project?
|
|
|
|
|
Kevin
exit Visual Studio, delete the projects *.clw file then start Visual Studio again. The Class Wizard file (*.clw) will be regenerated and all references to the ActiveX control should be gone.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
I want to add tol tip to my dialog & buttons.
what can I do for It.
Thanks a lot.
|
|
|
|
|
Hi, I am using CDaoDatabase to create an access database. I can create Access 97 ( JEt Database Engine version 1.0, 2.0 or 3.0) by passing third paremeter of CDaoDatabase->Create(DatabaseName, Language,Version).
Any body know what to pass as third parameter to create Access 2000 (Jet version 3.6) ??
try
{
newDB->Create(szNewDB, dbLangGeneral, 0);
}
catch( CDaoException e)
Help appreciated.
|
|
|
|
|
Answer to your question is:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&df=3&app=25&tid=25406&select=25406#xx25492xx
By the way, do you know how to change the MSysObjects attributes to read only thru VC?
I will be able to read tables info if I could do that. By default, MSysObjects cannot be read. I can change the setting thru Access 2000 but I want to do it thru VC!
|
|
|
|
|
What if you use SQL CREATE TABLE statemnt or even better the SQL Stored Procedures in your VC++ along with DAO, instead of the DAO lonely & directly?
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
I have used SDI, that use of CFormView class.
I want to change Document in my program.
For example i have two document.
when user choose First menu item, then program must indicate first document and when user choose Second menu item, program must indicate second document ...etc.
How can i ? (Please write example)
Hadi Rezaie
|
|
|
|
|
I want to know, how can I write the parameter flag on navigate method.
m_Navegador.Navigate( m_strIndice, flag, NULL, NULL, NULL);
I was trying to use the BrowserNavConstants struct, with the parameter navNoHistory. But there was anythings wrong there.
How can I set this parameter?
Marcio Henrique Doniak
Programming in C++. Using C++ and MFC, developping GUI for telecommunication equipment (PABX)
|
|
|
|
|
I want get the URL from
OnBeforeNavigate2Explorer1(LPDISPATCH pDisp, VARIANT FAR* URL, VARIANT FAR* Flags, VARIANT FAR* TargetFrameName, VARIANT FAR* PostData, VARIANT FAR* Headers, BOOL FAR* Cancel)
but, I don't know how can I do it... I'm using the ActiveX component (Microsoft Navigator) in a MFC application.
How can I use VARIANT FAR* URL and how can I cancel the navigation?
Cesario Simoes, jr
Working with computers since 1970 (Burroughs, GTE, etc.) Programming in assembly DSP (TMS320c2x and TMS320c5x), C and C++. Using C++ and MFC, developping GUI for telecommunication equipment (PABX, ACD, RAS, etc.)
|
|
|
|
|
string szUrl;
CComVariant varURL(*URL);
varURL.ChangeType(VT_BSTR);
_bstr_t url = varURL;
szUrl = (TCHAR*)url;
Good luck,
Dror
|
|
|
|
|
I have noticed an anoying bug in my context menu. Here it is:
I have a SDI App, with the base view class of CTreeView. I have split the frame in two views - Left is Tree, right is the ListView.
When i insert the following code in to the OnContextMenu function
CMenu menu;
menu.LoadMenu(IDR_MAIN);
CMenu pContext = menu.GetSubMenu(0);
pContext->TrackPopupMenu(this->m_hWnd, TPM_LEFTBUTTON|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
point.x, point.y, AfxGetMainWnd());
(I'm not sure if the parameters are in the same order - if they are not - ignore it, in the code they are correct)
The first time I right click it shows the popup menu which contains 2 functions, and also adds some elements from the help menu?! The second time i rclick it shows it as it should be. But if I display the context menu associated with the caption (Restore/Minimize/Close etc.) it makes the same stupid mistake.
What am I doing wrong?!
Any help appreciated,
Deian
|
|
|
|
|
sorry for the error -> pContextMenu is pointer(*)
|
|
|
|
|
Can i change the Menu's BAckground Color
how?
|
|
|
|
|
hi!
i am looking out for the same thing.have u found a method of changing the background color of a menu,if so pls tell me the method.
thanx
mariam
|
|
|
|
|
Hi,
How do i refresh hardware configuration programatically ?
I don't want to reboot the machine for doing the same.
How can i do that??.any idea...........
TIA
|
|
|
|
|
Continuing with my theme of building useless applications to utilise controls and programming practices to get a fuller understanding of the whole VC++ thing, I have come up with the following idea, but no way to implement it.
Wanted to add some data to my application via a String Table (don't want to use the Registry or write to hidden files) for use in calculations. Also wanted to enable the user to be able to re-map this data to new values that would be available next time the application was started. Seems that according to MSDN I can't write data to String Tables and can't find anything in books, magazines or web sites to help me along.
Anyone have any idea how I can get this idea to work?
Must be possible as Shareware applications (no I am not writing one or trying to hack one) must store the registration key somewhere for the app to know it is registered. Or at least write something to the executable to show it is registered. Don't believe that it would be written to the Registry or a hidden file as this would be comparitively easy to find.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Do you think ? Writing to the executable or a file in the local directory would be easy. Writing a nonsensical ( or at least obsfucated ) value to an obscure part of the registry would be far harder to find. How about creating a file with an unusual name in the Windows system directory and storing info there ? I have shareware programs that I am *sure* write to my boot sector as they still know I have expired my trial after a reformat of the HDD !! ( I own them and get the message after reinstall prior to entering my key ).
I guess all of these methods are kind of user hostile, but I'm sure they are harder to find than modifying the actual executable - surely the first place a hacker wsould look.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
hi,
Yupe,... string table is a resource and is read-only. I dont think its possible (to my knowledge) to alter it afterwards.
Thats the reason people go for registry or flatfiles. Actually there is no harm in writing to registry if its not too much data. There are lots of apps. which write to registry extensively .. eg. (www.groove.net).
Shareware programs. have the algorithm inside for generating the appropriate key. You give the username and reg.code, now the program has a key generator inside and hence it generates the corresponding reg.code for this user and compares it with the one you have entered and hence it can recoginize them. Some, shareware store the password info in an encrypted form(using techniques like md5 message digest) and store them in the registry.
Cheers
Kannan
|
|
|
|